Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

What is this article for

...

In this article you learn how to leverage controllers for executing tasks like displaying content and triggering processes for custom application logic.

...

  • Controllers are a single PHP file with a specific file name and a class name

  • All extend KenedoController

  • Each controller has a 'name', for example 'example', file names and PHP class names derive from it

  • There is a directory for built-in controllers and a directory for custom controllers (see File locations)

  • Task names (like 'display', 'store' etc) relate to controller method names.

  • Each controller class has 4 abstract functions that you implement. You override other methods as you see fit

...

First you create a PHP file holding the controllers PHP class. Location of custom controller file: {customization folder}/controllers/{controller name}.php (in our example 'example.php')

...

When it comes to outputting your view's content, you'd typically use a menu item (see the KenedoView article on 'On Joomla using a menu item'). For understanding's sake you see now how you call a controller task via URL routing in Joomla.

...