This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
en:tutorials:minitutorial:1.0.3 [2008/04/06 10:41] – laurent | en:tutorials:minitutorial:1.0.3 [2008/11/19 15:02] (current) – external edit 127.0.0.1 |
---|
How is this possible although we don't have anything in our controller ? | How is this possible although we don't have anything in our controller ? |
| |
We saww that getResponse('html') returns a jResponseHtml object. However, it is possible to return an other object for the "html" type. It can be an other object which inherits from jResponseHtml, and which set things which are common for all actions. For example: CSS style sheets, the main template etc. This is very useful because you don't need to repeat this settings in your actions. And because this is very useful, the //createapp// command creates a such class and a default template. This sort of class are stored in the //responses// directory of the application, and are declared in the configuration file. | We sww that getResponse('html') returns a jResponseHtml object. However, it is possible to return an other object for the "html" type. It can be an other object which inherits from jResponseHtml, and which set things which are common for all actions. For example: CSS style sheets, the main template etc. This is very useful because you don't need to repeat this settings in your actions. And because this is very useful, the //createapp// command creates a such class and a default template. This sort of class are stored in the //responses// directory of the application, and are declared in the configuration file. |
| |
Let's see the content of example/responses/myHtmlResponse.class.php created by //createapp//: | Let's see the content of example/responses/myHtmlResponse.class.php created by //createapp//: |
</code> | </code> |
| |
This "personnalized" response set up in bodyTpl the default template which will be used to generate the <body> content of all pages : "exemple~main". This is the main.tpl file in the example module. "exemple~main" is called a selector. A [[en:manual:selectors|Jelix selector]] is a shortcut to refer to a resource of a module. Here is the content of this template: | This "personnalized" response set up in bodyTpl the default template which will be used to generate the <body> content of all pages : "exemple~main". This is the main.tpl file in the example module. "exemple~main" is called a selector. A [[en:manual-1.0:selectors|Jelix selector]] is a shortcut to refer to a resource of a module. Here is the content of this template: |
| |
<code html> | <code html> |
| |
{{en:tutorials:minitutorial:minituto_4_en.png}} | {{en:tutorials:minitutorial:minituto_4_en.png}} |
| |
| |
STOP HERE. tutorial not updated in the below content. | |
| |
| |
| |
| |
===== Retrieving parameters ===== | ===== Retrieving parameters ===== |