Hi,
I am facing a problem using the static properties of a Controller Class. I declared a static property because I want to keep the ordering criteria when we reload the page, I thought if I save it in a Static property then I won’t loose it everytime I reload the page because it is supposed to be the same no matter what instance of the CommentController. So here is what I used:
class CommentController extends MyController
{
public static $order;
.....
public function actionComment(){
...
if(isset($_GET['order']))
$this::$order = $_GET['order'];
$model->order = $this::$order;
...
}
}
But everytime I reload the page the Static Properties gets back to NULL. If I give it a value in one of the instance of the CommentController, shouldn’t it be available as well in another instance of the same class after?
Maybe there is something I misunderstood about Static properties…
Thanks for any help!