how to convert an HTML template into Cake PHP template -
i'm beginner in cake php. have needed convert html template cake php template. idea?
it easy.
- replace template main file extension .ctp
index.html
index.ctp
- look @ layout of file (html code) , determine section of template want appear on pages;
usually templates setup follows:
<html> <head> <title>my site</title> // include javascript , css files here <?php echo $this->html->css(array('cake.generic','default')); echo $this->html->script(array('myscript','jquery')); ?> </head> <body> <div id="container"> <div id="header"></div> <div id="body"> <div id="main_content" style="width:600px;float:left"> <?php //code should in home.ctp // in pages folder. cut content // template , place whole thing in file // else happens magically echo $content_for_layout; ?> </div> <div id="side_content" style="width:300px;float:left"> <!-- can have content here manually or create elements , include them here following --> <?php $this->element("sidebar_content"); ?> </div> </div> <div id="footer">...</div> </div> </body>
you should upload images
/img
folder in/app/webroot
folderchange images path reference
/img
folder.you must same css , js files. place them in corresponding folders in
/app/webroot
location.
good luck!
Comments
Post a Comment