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:tutorials:minitutorial:1.1.x [2009/01/07 20:17] biboen:tutorials:minitutorial:1.1.x [2009/01/07 21:43] bibo
Line 8: Line 8:
 First, [[en:download:stable:1.1#developer-edition|download the "developer" edition of Jelix]]. Jelix requires at least PHP 5.2 (See [[en:manual-1.1:installation:requirements|here a detailed list of requirements]]) First, [[en:download:stable:1.1#developer-edition|download the "developer" edition of Jelix]]. Jelix requires at least PHP 5.2 (See [[en:manual-1.1:installation:requirements|here a detailed list of requirements]])
  
-Then unpack the archive file you have downloaded, with your archiver software companion. For example, with tar:+Thenunpack the archive file you have downloaded, with your archiver software companion. For example, with tar:
  
 <code bash> <code bash>
Line 16: Line 16:
 After this, you have a directory @@F@jelix-1.1/lib/@@ in which you'll find all libraries used by jelix, and jelix itself. After this, you have a directory @@F@jelix-1.1/lib/@@ in which you'll find all libraries used by jelix, and jelix itself.
  
-For the purpose of this tutorial, move jelix-1.1 folder in a directory of your web site. So that it will be accessible with a browser, at this URL for example: @@http://localhost/jelix-1.1/@@(You can rename @@F@jelix-1.1/@@ as you wish).+For the purpose of this tutorial, move jelix-1.1 folder in a directory of your web site. So that it will be accessible with a browser, at this URL for example: @@http://localhost/jelix-1.1/@@ (You can rename @@F@jelix-1.1/@@ as you wish).
  
 ===== Jelix scripts ===== ===== Jelix scripts =====
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 argumentAfter processing, the action returns this response thus 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 to @@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>
Line 153: Line 157:
 ==== Response object ==== ==== Response object ====
  
-The @@C@jResponseHtml@@ object generates HTML response (HTML page). It generates automatically the @@<head>@@ part of HTML, from some of its properties. Let's define the title of the page. Add this in the @@M@index()@@ method, before the return:+@@C@jResponseHtml@@ object generates an HTML response (an HTML page). It automatically generates the @@<head>@@ part of HTML, from some of its properties.  
 + 
 +Let's define the title of the page. Add this in the @@M@index()@@ method, just before returning the response object :
  
 <code php> <code php>
Line 159: Line 165:
 </code> </code>
  
-Reload the page. The title of the page is now display in your browser title bar. But the page contains this:+Reload the page. The page title should now correctly display in your browser title bar. But still your page contains this:
  
 {{en:tutorials:minitutorial:minituto_1_en.png}} {{en:tutorials:minitutorial:minituto_1_en.png}}

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

Recent changes RSS feed Creative Commons License