Now, we’ll make another example using templates. A little bit more work in HTML and we can get a better visual output.
Open the last project - Gui : The Zoop View (powered by Smarty). Using your favorite HTML editor browse to app_path/templates/default folder and open helloword.tpl file. Our intention is to create three separate sessions: top, middle and bottom. You can do this using tables, it’s the easier way, but div tags is recommended, actually. Div tags allow detailed formatting with CSS, and deliver HTML code with better semantic.
Use two smarty tags: {$lbl1} and {$lbl2}. $lbl1 at top and $lbl2 at bottom section:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="pt-br" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Ola_Mundo_com_Template</title> </head> <body> <div align="center" style="background-color: #FFE2C6; font-family: Tahoma; font-weight: bold"> <br/>{$lbl1}<br /> </div> <div style="background-color: #FFF4EA"> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> </div> <div align="center" style="background-color: #FFE2C6"> {$lbl2} </div> </body> </html>
Our next step is to edit zone_default.php file. In that file we can find the functions – one to each page in our project. Find pageDefault function and change it. Use the code below:
pageDefault($inPath) { global $gui; $gui->assign("lbl1", "Hello World"); $gui->assign("lbl2", "Vespersoft Desenvolvimentos - www.vespersoft.com.br"); $gui->display("helloworld.tpl"); }
To remember: the assign commands above will put the second argument at first argument variables. The $gui->display command will show the template. Just run your project to see the changes.
Helpful
Smarty templates really work. All must try your this particular piece of help. Good work from your side. Keep updating us in the same regard in future too. Hope to see the next piece very soon.
star sticker | flyers printing
Good Sharing
Information in this specific way is good to be presented so bundle of thanks for sharing it here. Don't you think that use of these tags simultaneously can create a problem in your coding?
Craigslist Alabama Jobs
valuable and excellent
valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration. Thanks for the great information Analytical Reasoning Book
A content management system
A content management system (CMS) is a system with a set of procedures used to manage the workflow in a collaborative environment. These procedures may be manual or computer based.In a CMS, data can be defined as almost anything: documents, movies, pictures, phone numbers, scientific data, and so on.
citrix pdf//comptia papers//eccouncil questions//emc papers//exin questions//hp prep//ibm pdf//
A very interesting read and
A very interesting read and a great post alltogether. thanks for sharing this information
incontri roma
donna cerca uomo