Hola
Como puedo declarar variables en un modelo, y que se puedan acceder a estas desde las funciones del mismo modelo?
<?php
class Modelo extends ActiveRecord{
$cols = "mis columnas";
$join = "mis join";
public function getModelo($page,$turno, $ppage=20){
$conditions = "mis conditions";
return $this->paginate("columns: $cols","join: $join","page: $page","per_page: $ppage","conditions: $conditions");
}
public function getModelo2($page,$turno, $ppage=20){
$conditions = "mis conditions";
return $this->paginate("columns: $cols","join: $join","page: $page","per_page: $ppage","conditions: $conditions");
}
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION
Comentarios
$this ->$cols ","join: $this ->join","page: $page","per_page: $ppage","conditions: $conditions");