开发者

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: &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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜