Convention over configuration inthe Dispatcher✤ The Dispatcher is your component’s router. It routes the request to the appropriate Controller based on conventions: ✤ A POST request gets routed to the save task ✤ A GET request to a plural view name gets routed to the browse task ✤ A front-end GET request with an ID gets routed to the read task ✤ A back-end GET request with an ID gets routed to the edit task
Convention over configuration inModels✤ Tables are named as #__component_view, e.g. #__todo_items✤ Auto increment ﬁeld is named component_view_id, e.g. todo_item_id✤ Magic ﬁelds: enabled, created_by, created_on, modiﬁed_by, modiﬁed_on, locked_by, locked_on, hits✤ You can override defaults without copying & pasting code, ever. Copy & paste is the devil!
Convention over configuration inControllers✤ Default tasks (not RESTful!): browse, read, edit, add, delete, save, apply, ...✤ Customize with onBeforeMethod and onAfterMethod methods, e.g. onBeforeSave. Dont copy & paste code.✤ All MVC objects can be passed a $conﬁg array to customize them. It "ﬂows" from dispatcher to component to model and view.✤ FOF guesses the task if its missing based on plural/singular view name and existence of ID in the query
Convention over configuration inViews✤ Views inherit from FOFView and its specialized children, e.g. FOFViewHtml✤ Customize using the onTask methods, e.g. onBrowse✤ The toolbar is handled outside the view, in a FOFToolbar descendant class. Override it with a toolbar.php ﬁle in the components root.✤ Magic toolbar methods, e.g. onItemsBrowse allow you to customize the toolbar without copying & pasting code.
HMVC – Hierarchical MVC✤ Include the results of component views anywhere (other views, other component, modules, ...)✤ FOFDispatcher::getTmpInstance(‘com_foobar’, ‘items’, array(‘layout’ => ‘fancy’))->dispatch();
Reuse view templates✤ Load a view template from another view, component, ...✤ echo $this->loadAnyTemplate(site:com_foobar/item/form);
Media files overrides✤ Load media ﬁles like this: FOFTemplateUtils::addCSS(media://com_foobar/css/frontend.css);✤ Media overrides are inside the template folder, e.g. templates/tpl_example/media/com_foobar/css/frontend.css
Services first – automatic JSONand CSV views✤ Just add format=json or format=csv✤ JSON: You have an instant JSON-based remote API for your components✤ CSV: You can quickly export whatever you see in the backend to Excel, Numbers, LibreOfﬁce, Google Docs, etc.✤ Transparent authentication support using URL parameters or HTTP Basic Authentication
XML-based views✤ It’s JForm on double dose of steroids✤ Browse, read and edit views from XML templates✤ You don’t need to write any PHP or HTML, but you can mix traditional PHP-based and XML-based templates, even in the same view✤ Overridable with Joomla! template overrides