Subtubes
Subtubes

Reputation: 16863

Generate SEF urls in Zend Framework 2

In ZF1 you were able to create a SEF urkl by doing the following

 <a href="<?php $this->url(array('controller'=>'MyCOntroller', 
 'action'=>'MyActions'));?>">My link</a>

how do we do that in ZF2?

Upvotes: 0

Views: 490

Answers (1)

Ocramius
Ocramius

Reputation: 25431

You achieve similar results also in Zend Framework 2 with something like following:

<a href="<?php echo $this->url(
    'route-name', 
    array('controller'=>'MyCOntroller',  'action'=>'MyActions')
); ?>">My link</a>

Check the reference about routing and the docs about the URL view helper and the Controller URL Plugin Helper

Upvotes: 1

Related Questions