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 21:06] biboen:tutorials:minitutorial:1.1.x [2009/01/07 21:50] bibo
Line 157: 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 163: 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 display accordingly 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}}
  
-How is this possible although we don'have anything in our controller ?+How is this possible whereas we don'define any content in our controller ?
  
-We saw that @@M@getResponse('html')@@ returns a @@C@jResponseHtml@@ object. However, it is possible to return an other object for the "html" type. It can be an other object which inherits from @@C@jResponseHtml@@and which set things which are common for all actions. For example: CSS style sheets, the main template etc. This is very useful because you don't need to repeat this settings in your actions. And because this is very useful, the @@createapp@@ command creates such class and a default template. This sort of classes are stored in the @@F@responses/@@ directory of the application, and are declared in the configuration file.+We have seen before that @@M@getResponse('html')@@ returns a @@C@jResponseHtml@@ object. However, it could return another object for the "html" type. It could be an instance of a class inheriting from @@C@jResponseHtml@@ and which set common things for all 'html' actions. Think about defining common CSS style sheets and JS scriptsyour application main template etc. This  class is very useful as you don't need to repeat this settings through all your actions. And because this is very useful, the @@createapp@@ command creates such class and a default template. it is stored in the @@F@responses/@@ directory of your application, and is declared in the configuration file.
  
 Let's see the content of @@F@example/responses/myHtmlResponse.class.php@@ created by @@createapp@@: Let's see the content of @@F@example/responses/myHtmlResponse.class.php@@ created by @@createapp@@:

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

Recent changes RSS feed Creative Commons License