Hi,

I currently have my default template, containing the standard footer
and the header for every page on my site.

Within the header I want to put a select box that contains a drop down
of all the searchable locations gathered from the database. I have
written a controller (for testing) and the select list can be
generated fine using the generatetreelist function.

At the moment I am confused how to go about making this drop down part
of the default.ctp template.

My code at the moment is:


Model
############
<?php
class Location extends AppModel {
        var $name = 'Location';
        var $actsAs = array('Tree');
}
?>


Controller
#'###########
<?php
class LocationsController extends AppController {

        var $name = 'Locations';
        var $helpers = array('Html', 'Form');

        function index() {

                $this->data = $this->Location->generatetreelist(null,
null, null, '. . ');

        }
}
?>


\app\views\locations\index.ctp
#'###########
<?php echo $form->select('Category', $this->data, null, array(),
'Select a Location'); ?>

Thank you

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to