Muneer
Muneer

Reputation: 7564

generate URL within ZF2 actions

What is the best way to generate URLs within inside Zendframework 2 Controller/Action ?

Available Route : 'application'

Controller : 'Customer'

Action : 'Update'

Upvotes: 0

Views: 75

Answers (1)

Mohammad Mehdi Habibi
Mohammad Mehdi Habibi

Reputation: 1623

try:

public function someAction()
{
    //use url plugin in controller
    $link = $this->url()->fromRoute('application', array('controller'=>'customer','action'=>'update'));
}

Upvotes: 1

Related Questions