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 revision
Previous revision
Next revisionBoth sides next revision
en:minitutorial [2006/09/18 11:12] doublefaceen:minitutorial [2006/11/08 11:04] – (old revision restored) 127.0.0.1
Line 124: Line 124:
       $rep->body->assign('name','Me');       $rep->body->assign('name','Me');
 </code> </code>
 +
 +
  
 ==== As a summary ==== ==== As a summary ====
-The code of the conroller must now be like this :+The code of the controller must now be like this :
  
 <code php> <code php>
Line 142: Line 144:
 } }
 </code> </code>
 +
 +
 +
 +===== First display =====
 +
 +We are now ready to display our page. For this, give the following URL :
 +  http://localhost/jelix/helloapp/www/index.php?module=hello&action=default_index
 +
 +You will then see your html page, with the welcome message.
 +
 +The url can change regarding the configuration of your installation, especially if you have specified the document root of the site on the directory helloapp/www. You have to know that Jelix can handle the significant url to avoid all this disgusting parameters. 
 +
 +
 +
 +===== Retrieving parameters =====
 +
 +It would be interesting to be able to indicate as parameter of the url, the name to display in the template.
 +
 +<code php>
 +   $name = $this->param('name');
 +   $rep->body->assign('name', $name);
 +</code>
 +
 +Now type :
 +    http://localhost/jelix/helloapp/www/index.php?module=hello&action=default_index&name=Robert
 +
 +-----
 +   * Go back to the [[en:manual|manual]]
 +   * Continue to discover Jelix with the [[en:tutorial|main tutorial]]
  
Recent changes RSS feed Creative Commons License