如何使用zend框架创建规范链接

Ben*_*enI 1 zend-framework canonical-link

我是使用zend框架的新手.我已经搜索但没有得到如何使用zend框架1创建规范链接的解决方案.

rel该属性link元素应该有canonical,nextprevious根据网页上你是.

例如,当在此页面(www [dot] example.co.uk/index/testimonials/)时,链接应为:

<link rel="canonical" href="http://www.example.co.uk/index/testimonials/”/> <link rel="next" href="http://www.example.co.uk/index/testimonials/page/2”/>

Ben*_*enI 7

我在我的视图/脚本文件中以不同的方式完成了它;

        $this->headLink(array('rel' => 'canonical', 'href' => 'http://www.example.com/index/news?page=1'));
        if ($this->page < count($this->newsList)){
            $this->headLink(array('rel' => 'next', 'href' => 'http://www.example.comk/index/news?page='.($this->page + 1)));
        }
        if ($this->page > 1) {
            $this->headLink(array('rel' => 'prev', 'href' => 'http://www.www.example.com/index/news?page='.($this->page - 1)));
        }
Run Code Online (Sandbox Code Playgroud)