ehutchison
-
Posts
7 -
Joined
-
Last visited
Never
Posts posted by ehutchison
-
-
correct, but be sure you have the debug level properly set. should be in app/config/core.php
Configure::write('debug', 1);
Using debug is similar to doing a print_r(); with <pre></pre> tags
-
I'm Ehutchison, and I approve this post.
You can pass variables to the layout from the controller.
So, in your about controller, you can have something like...
function about() { // controller logic ... $this->set('page_for_layout', 'about'); ... }
Then, depending on how your menu and css is set up, you can have something like this in your default.ctp
<ul class="<?php echo $page_for_layout; ?>"> <li><a href='#'>Home</a></li> <li><a href='#'>About</a></li> </ul>
In your css, you would have something like
.home a { //some style } .about a { //some style }
There are probably other ways, but I like this one.
-
So if I understand you correctly..
I will assume you have a 'home' page and a 'about us' page. When your on the 'about us' page you want it to highlight the 'about us' link, and if on the 'home' page, you want it to highlight 'home' somehow?
-
Im a cake person myself
As everyone has said, pick the right tool for the right job.
-
I am not sure how you began your developement. Did you start locally, and move it to a webserver later? If so, check your /app/webroot/index.php file. Inside that file are some important path related variables which will need to be changed.
-
From what I understand with cake, there are two ways to do a query.
The cake way
http://book.cakephp.org/view/73/Retrieving-Your-Data
using the find command.
<?php $result = $this->Postjob->find('list', array('conditions'=>array("Postjob.title LIKE'=>'%'.$title.'%'))); ?>
The other method, which should not be used often in my opinion
http://book.cakephp.org/view/456/query
<?php $result = $this->Postjob->query("SELECT * FROM WHERE Postjob.title LIKE '%".$title."%'"); ?>
I hope this helps.
menu highlight to show current page in CakePHP
in Frameworks
Posted
check out this page for information on minyear and max year.
also, be sure to make sure you validate the information.
http://book.cakephp.org/view/189/Automagic-Form-Elements