1
我在我的模型,如创建一个函数:设置参数与TableGateway选择功能显示错误未定义的变量
public function getAllMenuByOnlyActionPage($actionlot){
$act = trim($actionlot);
$result = $this->tableGateway->select(function (Select $select) {
$select->where(array('status != ?' => 13))
->where(array('action' => $act))
->order('id ASC');
});
$results = array();
foreach ($result as $row) {
$results[] = $row;
}
return $results;
}
当我尝试执行那么它告诉我Notice: Undefined variable: act
。我已经看到这个链接ZF2 tableGateway select,但我想为此功能设置参数。由于
感谢,如果你有这样的参考链接,请给我联系它的工作原理。 – imsyedahmed 2013-03-21 07:43:31