Jump to content

ehutchison

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Posts posted by ehutchison

  1. 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.

  2. 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.

  3. 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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.