我在我的模型中创建了一个函数,例如:
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但我想为这个函数设置参数。谢谢