如果我需要在view.phtml中创建一个链接,使用这个:
$this->url('router',array())
public function someAction() { //codes //use url plugin in controller $link = $this->url()->fromRoute('router',array()); //or use ViewHelperManager in controller or other place that you have ServiceManager $link = $this->getServiceLocator()->get('ViewHelperManager')->get('url')->__invoke('router',array()); //codes }