Reputation: 13
I am new on Codeigniter and i have a question. In controller classes i need to use session, request and validation objects in every method So for each method i have to create an instance of them like below:
$session=\Config\Services::session();
$validation=\Config\Services::validation();
$request=\Config\Services::request();
How can i make one instance for whole the controller methods? I tried to creat property but it seems that i can not use an object as a property I would be thankful if you help me with that
Upvotes: 1
Views: 88