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="" rel="canonical" />

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

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

 $this->view->headLink()->headlink(array('rel' => 'canonical', 'href' => ''), 'PREPEND');

Open in new window

SlimshaneeyAuthor Commented:
Answered it myself!
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.