Reputation: 11471
I am new to PHP and today I was able to display my first list of items using CakePHP yay! but, whatever I display always shows with the default format. How can I override my view to show the page how I had it in html? Where do I put the css, javascript and images? Before this my HTML had this in the header
<link rel="stylesheet" href="css/stylestopmenu.css" type="text/css" />
<link rel="stylesheet" href="css/stylessidemenu.css" type="text/css" />
<link rel="stylesheet" href="css/jquery.rating.css" type="text/css" />
<link rel="stylesheet" href="css/specialtablemenu.css" type="text/css" />
<link rel="stylesheet" href="css/admintable.css" type="text/css" />
<script type="text/javascript" src="javascript/jquery.min.js"></script>
I have no idea how to style it so that it displays as before. Right now it shows like this
I wouldn't like to totally get rid of this as it tells me errors but, how can i do it so that I can style the page, maybe somewhere else?, please forgive me, I am new to PHP and its been hard for me to understand the tutorials. I would appreciate any help.
Upvotes: 0
Views: 236
Reputation: 50019
CakePHP lets you override pretty much anything, you just need to understand its structure. The best thing to do is to copy the default.ctp file from your cake folder in APP_DIR\cake\libs\view\layouts\default.ctp
.
Once you've copied this, place it in APP_DIR\app\views\layouts\
and cake will start using that file. To customize it, simply open up that file and change it in your editor.
Upvotes: 2
Reputation: 100175
You need to define your custom layout in your controller to override default layout:
//in controller say in beforeFilter function beforeFilter() { parent::beforeFilter(); $this->layout = "your_layout_name"; }
Hope it helps
Upvotes: 0