mbannonb (7) [Avatar] Offline
#1
in application/views/scripts/menu.phtml I put:

echo $this->_helper->render('_search.phtml');

but it generates an error, "call to a member function on a non-object".

I've tried different variations of blah->render(), but I'm really just pushing the code around and have no idea what I'm doing.

Looking at 4.8 in the book and the explanation, I am unable to apply what is there to getting the search box to appear after the header nav (Home, Places, Articles, etc.)

I created a helper in views/helpers/SearchBox.php, and it works if I use

$view=new Zend_View;
$val=$view->escape($_GET['q']);

and

$controller = Zend_Controller_Front::getInstance();
$controller->getBaseUrl()

But I still don't know what I'm doing.

On another note, doing a search for "escape" on zend returns "no results found" http://framework.zend.com/manual/search?query=escape&language=en&version=1.7&search=Search+Manual

Any guidance is appreciated.
mbannonb (7) [Avatar] Offline
#2
Re: putting the search box up with the header nav
I figured it out.

I moved _search.phtml from views/scripts/layouts/_search.phtml

to

views/scripts/index/_search.phtml

I took the line of code from views/layouts/layout.phtml

$this->render("_search.phtml"smilie;

and put it in

views/scripts/index/menu.phtml,

I added the pathway "index" to the render call:

$this->render("index/_search.phtml"smilie;

I also changed the form's html so it would fit better.