Private vairable not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Private vairable not working (/showthread.php?tid=65801) |
Private vairable not working - wolfgang1983 - 07-26-2016 On the top above my __construct() area in my library I have a variable called $set_the_time_for_cookie_to_expire because the time() has brackets it is throwing error Code: A PHP Error was encountered Is there any way to be able to use php time() like what I am after? PHP Code: private $customer_id; RE: Private vairable not working - InsiteFX - 07-26-2016 Create a set and get method to set and get the cookie expire time. RE: Private vairable not working - Wouter60 - 07-26-2016 Assign the value in the __construct method. PHP Code: private $set_the_time_for_cookie_to_expire; RE: Private vairable not working - InsiteFX - 07-26-2016 Yep that will work also but I would still create the set and get methods so that if you ever want to change the expiration time you can. |