Controllers?

A forum for Bolt related questions / issues

Controllers?

Postby Kenny » Mon Oct 29, 2012 11:56 am

Hi

I have been playing around with Bolt and it seems great so far. It seems particularly good for pages that just involve creating particular content types and simply getting and displaying these on a pages template. I also like that the admin is smart phone and tablet friendly and that the whole thing is lightweight and simple for both users, editors and designers/developers.

However, what if you need to do more than just create data in the CMS and display it in a template? For example what if you need to process some content type data first or what if you want to say, create a form for a user to enter some data and then do something with that data? For example a contact form or user reviews/discussions?

If I compare it to the MVC design pattern and take the content types to be the model and the templates to be the views, does Bolt have controllers or is this something that will be included further down the roadmap? Or is this outside the scope of Bolt and it's purposefully simple nature?

Sorry if this is a silly question.

Thanks
Kenny
 
Posts: 27
Joined: Mon Oct 29, 2012 11:46 am
Location: UK

Re: Controllers?

Postby Bob » Mon Oct 29, 2012 3:57 pm

Hi,

I'm not entirely sure where the "inside the scope" for Bolt ends. Personally, I'd like to keep it as lean as possible, but I understand the need for people to have more features for some projects.

The upcoming beta (0.8) will have support for Extensions. This will allow for things like simple forms, etc. In fact, one of the example extensions that i've created is aptly named "SimpleForms". ;-) (screenshots here)

Your other example is something that could also be handled easily by the extensions in 0.8:
For example what if you need to process some content type data first

Just create an extension for a twig-tag or filter. Then your templates will allow you to use {{ mytagname(content) }} or {{ content|mytagname }}

Also, yes, Bolt does definitely have controllers. Open up app_frontend.php, and you'll see them. Silex is a microframework, that claims to be 'the Controller' part. If we build on that analogy:

- The 'Model' is defined in contenttypes.yml and accessed through $app['storage']. I think that's the way i'd like to keep it to stay simple. For now at least.
- Silex (in our case, mostly the app_backend.php, app_async.php and app_frontend.php) is the 'Controller' part. Currently you can't extend these through extensions yet, but you will be able to add them before 1.0. This would allow you to create custom applications on the frontend, or modify/extend behaviour in the backend.
- The twig template renderer is basically the 'View' part. This will be extensible in 0.8.

To answer you question: Bolt currently has a bunch of controllers, because that's the way Silex works. By creating Extensions, you'll be able to add your own as well before 1.0, without compromising the "simple" aspect of Bolt.
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Controllers?

Postby Kenny » Mon Oct 29, 2012 5:23 pm

Hi Bob,

Thanks for your reply. That all sounds great. I saw extensions on the roadmap and figured that might be the case but just wanted to be sure. Really looking forward to this new feature and also being able to relate content types.

Thanks again.
Kenny
 
Posts: 27
Joined: Mon Oct 29, 2012 11:46 am
Location: UK


Return to Bolt Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron