2016-05-31 28 views
0

CODEZF2是不是讓我做錨標記在一個字符串

$responeHTml .= '<li class="col-xs-3"> <a href="'. $this->url("delete-export-rt", array("sid" => $sid, "row"=>$var->export_history[$i]["id"])).'> <i class="fa fa-trash-o"></i> 
         <div class="caption">Delete</div> 
         </a> 

錯誤

Catchable fatal error: Object of class Zend\Mvc\Controller\Plugin\Url could not be converted to string

回答

1

您正在使用控制器助手,而不是視圖助手,你以爲你是。

通過在控制器中調用$this->url();,您可以獲得幫助器實例。那麼你應該打電話fromRoute方法來獲取網址。

$this->url()->fromRoute("delete-export-rt", array("sid" => $sid, "row"=>$var->export_history[$i]["id"])) 

This是你想使用的插件。

+0

謝謝你這麼多 –

相關問題