3.1.1 Controllers
Overview:
- What is a Controller?
- Which controllers can you find in our system?
- How do I get data from controllers?
A controller is used to intialise a pages data in the system, e.g. a blog page. Controllers are then used to create Collections or Entities of data.
A blog pages data can fx. is initialised through a controller, as shown below.
*CODE* *SNIPPIT* {* Fetch a blogController and set it as primary *}{controller type=blog assign=controller primary=true}*CODE*
As shown above, it is possible to specify a standard parameter from the system and URL’s (Example: Use the ISO code and Specific ID) by setting primary=true.
Which controllers can be found in the system?
Use the code below to see what controllers you can find in the system (This opens up in a popup window).
*CODE* *SNIPPIT* {help}*CODE*
How can I get data from a controller?
When a controller is initialised, you need to use a Collection or Entity to get data out into an array.