parent
fead411f87
commit
688de03db2
@ -1,8 +1,10 @@
|
|||||||
Controllers
|
Controllers
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Controllers live in ``/lib/gluon/web/controller``. They define which pages ("routes")
|
Controllers live in the ``controller`` subdirectory of a gluon-web application
|
||||||
exist under the ``/cgi-bin/gluon`` path, and what code is run when these pages are requested.
|
(``/lib/gluon/config-mode/controller`` for the config mode,
|
||||||
|
``/lib/gluon/status-page/controller`` for the status page). They define which pages ("routes")
|
||||||
|
exist under the application base URL, and what code is run when these pages are requested.
|
||||||
|
|
||||||
Controller scripts usually start with a *package* declaration, followed by calls
|
Controller scripts usually start with a *package* declaration, followed by calls
|
||||||
to the *entry* function, which each define one route:
|
to the *entry* function, which each define one route:
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
Models
|
Models
|
||||||
======
|
======
|
||||||
|
|
||||||
Models are defined in ``/lib/gluon/web/model``. Each model defines one or more
|
Models are defined in the ``model`` subdirectory of a gluon-web application
|
||||||
forms to display on a page, and how the submitted form data is handled.
|
(``/lib/gluon/config-mode/model`` for the config mode; the status
|
||||||
|
page does not use any models). Model support is not part of the gluon-web core
|
||||||
|
anymore, but is provided by the *gluon-web-model* package.
|
||||||
|
|
||||||
|
Each model defines one or more forms to display on a page, and how the submitted
|
||||||
|
form data is handled.
|
||||||
|
|
||||||
Let's start with an example:
|
Let's start with an example:
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
Views
|
Views
|
||||||
=====
|
=====
|
||||||
|
|
||||||
The template parser reads views from ``/lib/gluon/web/view``. Writing own view
|
The template parser reads views from the ``view`` subdirectory of a
|
||||||
should be avoided in favour of using :doc:`model` with their predefined views.
|
gluon-web application (``/lib/gluon/config-mode/view`` for the config mode,
|
||||||
|
``lib/gluon/status-page/view`` for the status page).
|
||||||
|
Writing own views should usually be avoided in favour of using :doc:`model`
|
||||||
|
with their predefined views.
|
||||||
|
|
||||||
Views are partial HTML pages, with additional template tags that allow
|
Views are partial HTML pages, with additional template tags that allow
|
||||||
to embed Lua code and translation strings. The following tags are defined:
|
to embed Lua code and translation strings. The following tags are defined:
|
||||||
|
Loading…
Reference in New Issue
Block a user