This shows you the differences between two versions of the page.
quickstart [2013/01/11 15:32] 80.169.157.170 old revision restored |
quickstart [2014/04/05 02:52] (current) 81.187.95.96 old revision restored |
||
---|---|---|---|
Line 27: | Line 27: | ||
===== Gathering of data ===== | ===== Gathering of data ===== | ||
- | This is not a requirement, but good advice: avoid passing PHPTAL object (or template abstraction wrapper) around your entire program. MVC programs should be independent of their views (metal exercise: would your application break if there was no view?). | + | This is not a requirement, but good advice: avoid passing PHPTAL object (or template abstraction wrapper) around your entire program. MVC programs should be independent of their views (mental exercise: would your application break if there was no view?). |
Instead of setting variables directly on PHPTAL object, make your methods //return// all required information. You can also pass helper objects to PHPTAL which will load data on demand. | Instead of setting variables directly on PHPTAL object, make your methods //return// all required information. You can also pass helper objects to PHPTAL which will load data on demand. | ||
Line 59: | Line 59: | ||
<code xml> | <code xml> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
- | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | + | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\\ |
- | <html xmlns="http://www.w3.org/1999/xhtml" metal:define-macro="layout"> | + | <html xmlns="http://www.w3.org/1999/xhtml" metal:define-macro="layout">\\ |
- | <head> | + | <head> |
- | <title tal:content="title"/> | + | <title tal:content="title"/> |
- | <tal:block metal:define-slot="other-stuff-in-head"/> | + | <tal:block metal:define-slot="other-stuff-in-head"/> |
- | </head> | + | </head> |
- | &lt;body> | + | <body> |
- | <div id="main"><tal:block metal:define-slot="maincontent"/></div> | + | <div id="main"><tal:block metal:define-slot="maincontent"/></div>\\ |
- | </body> | + | </body> |
- | </html> | + | </html> |
</code> | </code> | ||