Skip to content

Commit

Permalink
doc controllers line break
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheron committed Oct 18, 2017
1 parent caab099 commit 51b2bdd
Showing 1 changed file with 47 additions and 9 deletions.
56 changes: 47 additions & 9 deletions docs/controller/controllers.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
Ubiquity Controllers
====================
A controller is a PHP class inheriting from ``micro\\controllers\\Controller``, providing an entry point in the application.
Controllers and their methods define accessible URLs.
| A controller is a PHP class inheriting from ``micro\\controllers\\Controller``, providing an entry point in the application.
| Controllers and their methods define accessible URLs.
Controller creation
-------------------
The easiest way to create a controller is to do it from the devtools.

From the command prompt, go to the project folder.
To create the Products controller, use the command:
| From the command prompt, go to the project folder.
| To create the Products controller, use the command:
::
Micro controller Products

The Products.php controller is created in the ``app/controllers`` folder of the project.

::
<?php
namespace controllers;
/**
* Controller Products
**/
/**
* Controller Products
**/
class Products extends ControllerBase{
public function index(){}
Expand All @@ -32,8 +31,47 @@ It is now possible to access URLs (the ``index`` method is solicited by default)
example.com/Products/index

.. note:: A controller can be created manually. In this case, he must respect the following rules:

* The class must be in the ``app/controllers`` folder
* The name of the class must match the name of the php file
* It must inherit from ``ControllerBase`` and be defined in the namespace ``controllers``
* It must override the abstract ``index`` method

Methods
-------
public
^^^^^^

private
^^^^^^^

Default controller
------------------

views loading
-------------
loading
^^^^^^^

view parameters
^^^^^^^^^^^^^^^

view result as string
^^^^^^^^^^^^^^^^^^^^^

view engine
^^^^^^^^^^^

initialize and finalize
-----------------------

Access control
--------------

Dependency injection
--------------------

namespaces
----------

Super class
-----------

0 comments on commit 51b2bdd

Please sign in to comment.