problem with putting query into $this -> in Zend
开发者_StackOverflow社区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?
$this->headTitle($this->query->getQuery());
Or perhaps something a little more user friendly:
$this->headTitle('Search results for: "'.$this->query->getQuery().'"');
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.
You can get the query from the request with the getQuery()
method.
精彩评论