Trace:
Differences ¶
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
en:tutorial:action-creation [2006/09/26 16:12] – doubleface | en:tutorial:action-creation [2006/09/28 07:39] – doubleface | ||
---|---|---|---|
Line 61: | Line 61: | ||
All the body of the page, i.e the content of the html tag < | All the body of the page, i.e the content of the html tag < | ||
Before beginning to code, let's see the content of the template | Before beginning to code, let's see the content of the template | ||
+ | |||
Line 73: | Line 74: | ||
As we said earlier, the content of the template will be the content of the < | As we said earlier, the content of the template will be the content of the < | ||
+ | |||
+ | |||
+ | |||
+ | ==== Using the template in the action ==== | ||
+ | |||
+ | Let's see what we now have in the controller : | ||
+ | |||
+ | <code php> | ||
+ | class CTDefault extends jController { | ||
+ | |||
+ | | ||
+ | $rep = $this-> | ||
+ | $rep-> | ||
+ | $rep-> | ||
+ | return $rep; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | We the added an instruction to specify to the response that we use the newslist.tpl template. | ||
+ | |||
+ | A [[en: | ||
+ | |||
+ | |||
+ | ===== First display ===== | ||
+ | |||
+ | We are now ready to display the first version of our action. For this, type the following url in your browser : | ||
+ | |||
+ | http:// | ||
+ | |||
+ | 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/ | ||
+ | |||
+ | <code ini> | ||
+ | defaultModule = " | ||
+ | defaultAction = " | ||
+ | </ | ||
+ | |||
+ | You can then use the following url : | ||
+ | |||
+ | http:// | ||
+ | |||
+ | To display our first page. | ||
+ | |||
+ | |||
+ | ---- | ||
+ | * Next : [[en: | ||
+ | * Previous : [[en: | ||
+ | * [[en: |