Quick links: Content - sections - sub sections
EN

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
en:tutorial:action-creation [2006/09/28 07:29] doublefaceen:tutorial:action-creation [2006/09/28 07:39] doubleface
Line 74: Line 74:
  
 As we said earlier, the content of the template will be the content of the <body> tag. That's why you don't have to give the <html>, <head>, ... tag. Only the content of the <body> tag. As we said earlier, the content of the template will be the content of the <body> tag. That's why you don't have to give the <html>, <head>, ... tag. Only the content of the <body> tag.
 +
  
  
Line 96: Line 97:
 A [[en:manual:selectors|selector]] comprise a module name and a resource name separated by the "~" character, like this: "module_name~resource_name". The "module_name~" part is not mandatory when this is the current module. The resource name is not obligatorily a file name, even if, most of the time, it is a file name. The object which uses the [[en:manual:selectors|selector]] ([[en:manual:templates|jTpl]] here) knows haw to retrieve the file corresponding to the [[en:manual:selectors|selector]]. You will see that the selectors are very often used and allow a certain flexibility and independence from physical paths. A [[en:manual:selectors|selector]] comprise a module name and a resource name separated by the "~" character, like this: "module_name~resource_name". The "module_name~" part is not mandatory when this is the current module. The resource name is not obligatorily a file name, even if, most of the time, it is a file name. The object which uses the [[en:manual:selectors|selector]] ([[en:manual:templates|jTpl]] here) knows haw to retrieve the file corresponding to the [[en:manual:selectors|selector]]. You will see that the selectors are very often used and allow a certain flexibility and independence from physical paths.
  
 +
 +===== First  display =====
 +
 +We are now ready to display the first version of our action. For this, type the following url in your browser :
 +
 +  http://localhost/jelix/actu.org/www/index.php?module=news&action=default_index
 +
 +You will then see the content of the template we created on the screen.
 +
 +The action parameter is the name of the action to be executed. It is made from to parts, separated by an underscore (_). The first part is the name of the controller, the second part is the name of the method to be executed.
 +
 +We can specify that this action will be the default action of the application. For this, open the configuration file actu.org/var/config/config.classic.ini.php and specify it :
 +
 +<code ini>
 +defaultModule = "news"
 +defaultAction = "default_index"
 +</code>
 +
 +You can then use the following url :
 +
 +  http://localhost/jelix/actu.org/www/index.php
 +
 +To display our first page.
 +
 +
 +----
 +   * Next : [[en:tutorial:config-base|Configuration of the database]]
 +   * Previous : [[en:tutorial:application-creation|Application creation]]
 +   * [[en:tutorial|Back to the tutorial]]

en/tutorial/action-creation.txt · Last modified: 2007/09/17 22:42 by 127.0.0.1

Recent changes RSS feed Creative Commons License