How do I add a <Link rel="canonical" tag to the head of a page from an Action in Zend Framework?

Hi there,
Im using the full Zend framework stack on a website with MVC and all that gubbins. I have an action that does some task, but it has a number of routes into it. I want to insert a tag like this into the head from that action:
<link href="http://myurl.com/action/id/1" rel="canonical" />

I know how to set headers but that seems to only be for meta tags. How do I insert a link?

S
LVL 11
SlimshaneeyAsked:
Who is Participating?
 
SlimshaneeyAuthor Commented:
Answered my own question!

 $this->view->headLink()->headlink(array('rel' => 'canonical', 'href' => 'http://myurl.com/canonical'), 'PREPEND');

Open in new window

0
 
SlimshaneeyAuthor Commented:
Answered it myself!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.