In your controller, you have an action:
function add() {
...
$categories = $this->Listing->Category->generatetreelist(null, null, null, ' ');
$this->set(compact('categories','keywords','metros','states'));
}
where ' ' is your spacer.
Your view will have something like this:
...
echo $form->input('Category');
...
The above combination will display a drop down menu with the '&nsbp;' printed as ' ' and not as a space. So how would you do it in cakePHP 1.2?
The key here is in the view file.
instead of the above statement, you should have this:
...
echo $form->input('Category', array('escape' => false));
...
Hope this one helps.
2 comments:
Good Article Bro.. It really works well. Helped me.
holy crap, i've been looking for the solution this for a while, so simple! thanks!
Post a Comment