views:

35

answers:

2

the engine in using zend, here is my get query

<input type="text" name="q" value="<?php echo $this->query->getQuery(); ?>">

and here is my title tag

$this->headTitle('Homepage');

I would like to put the query keyword replacing Homepage, I have tried parsing many different codes but out of luck, anyone can help?

A: 

You can get the query from the request with the getQuery() method.

robertbasic
A: 
$this->headTitle($this->query->getQuery());

Or perhaps something a little more user friendly:

$this->headTitle('Search results for: &quot;'.$this->query->getQuery().'&quot;');

This code can go in your controller, view or plugins - whichever you feel is the most logical. If it's not in the view you'll need to change $this to whatever it should be.

Tim Fountain
thanks, finally i knew what was wrong with my previous code
webdev28