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:tutorials:minitutorial:1.1.x [2009/01/07 20:18] biboen:tutorials:minitutorial:1.1.x [2009/01/07 21:04] bibo
Line 118: Line 118:
 ===== Implementing an action ===== ===== Implementing an action =====
  
-Let's implement a default action. An action is a process which generates a page. It is implemented as a method in a class called a "controller", and a controller can implement several actions. Open the @@F@example/modules/example/controllers/default.classic.php@@ file:+Let's implement a default action. An action is a process which generates a page. It is implemented as a method in a class called a "controller". A controller can implement several actions.  
 + 
 +Open @@F@example/modules/example/controllers/default.classic.php@@ file:
  
 <code php> <code php>
Line 135: Line 137:
 </code> </code>
  
-We state here that we retrieve a @@C@jResponseHtml@@ object throw the @@M@getResponse()@@ method because of the "html" type as it is indicatedThen we return it to indicate that its content must be returned to the browser.+What this code means is that **index** action of **default** controller retrieves a @@C@jResponseHtml@@ object through the @@M@getResponse()@@ method by passing "html" as argumentAnd at the end, it returns this response indicating that its content must be returned to the browser.
  
  
-@@C@jResponseHtml@@ has a @@P@body@@ property, which is a @@C@jTpl@@ object. jTpl is a template engine provided by Jelix. In the controller, you see that the @@C@assignZone()@@ method is calledIt says: get the content of the 'check_install' zone which is stored in the 'jelix' module, and put this content into the template variable named @@V@MAIN@@You will see what is a zone later. 'Check_install' zone is a zone which show the main content of the start pageAs we don't need it anymoredelete this line so you will have this in your controller:+@@C@jResponseHtml@@ has a @@P@body@@ property, which is a @@C@jTpl@@ object. jTpl is a template engine provided by Jelix.  
 +In the action code above, you see a call @@C@assignZone()@@ method. This means : get the content of the 'check_install' zone which is stored in the 'jelix' module, and assign this content to the template variable named @@V@MAIN@@ (You will see what is a zone in details later). 'Check_install' is a zone which shows results of install checkingsIf those results are ok, you don't need it anymoredelete this line so you will have this in your controller:
  
 <code php> <code php>

en/tutorials/minitutorial/1.1.x.txt · Last modified: 2012/04/15 08:36 by laurent

Recent changes RSS feed Creative Commons License