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.

  1. replace template main file extension .ctp
  2. index.html index.ctp
  3. look @ layout of file (html code) , determine section of template want appear on pages;
  4. 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> 

  5. you should upload images /img folder in /app/webroot folder

  6. change images path reference /img folder.

  7. you must same css , js files. place them in corresponding folders in /app/webroot location.

good luck!


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -