Your Open Source

 
Related Posts

SET THE CSS FOR THE CAKE PHP

in general method:



<?php echo $html->css('styles'); ?>




how to set the css file for the particular controller and particular action.

<?php 

class NotesController extends AppController
{
var $name = 'Notes';
function index()
{
$this->set("CSS", "main"); // main is the css file name
}
function addnotes($id){
$this->set("CSS", "addnote"); // addnote is the css file name
}
}
?>

view page :

in the view page you get like this ..






Another one method :


the CSS files will have the same name of their controllers, that is, an Notes controller will have an mote.css. So we will have a project a little more organized, and we will find the CSS files easier







one CSS file for each method of controller


we will separate each CSS for one method.




or


  • hits 332
  • datetime Oct 31 08 12:12:49
  • author Damu
  • rating

Rating : 12345
Tags :- Framework

Answers

No Answers..
Your Name:
Your Answers :
<> is a code tag
Preview
Enter the verification code: