Joomla - Module: Using Template for Layout Flexibility (Part 6)Tag: joomla, cms Category: PHP Frameworkpost: 21 Nov 2007 read: 1,478 In this tutorial, we try to build template system for our module. Template is something that produce output to browser. We will exclude all output in mod_hello and put it to layout file. First, change code mod_hello like following code:
What's that mean? We don't use echo again at this line code. Because, output will put at renderHello (in modHelloHelper class). Ok, now we go to helper.php. Change renderHello with following code:
We don't use return $link anymore because mod_hello.php doesn't have output. Now, we use layout. This layout at file named "_hello.php". create folder named "tmpl" within joomla/modules/mod_hello. Then, create file name "_hello.php" within joomla/modules/mod_hello/tmpl. Enter following code:
You have template at your module. |
| | Give Your Opinion | Recommend |
|

