Checking if application is closed/open? |
[eluser]EEssam[/eluser]
Hello, I'm lost a little bit. So here's one of the issues I'm currently facing. I've an autoloaded model to get the application settings from DB (See this please). Now one of my settings is called "appactive" and I need to check if the app is active every time the app is requested, so I decided to create another model that I'll autoload and call it Init_model where I have something like: // Check if the site is closed if (!$this->settings_model->options['appactive']) { $this->load->view($this->settings_model->options['style'] . '/closed', $this->data); } It's not working and I'm not very interested in finding why it's not working because it's not good to call a view file from a model anyway. If I place the previously mentioned code in a controller it works but it's not logical to repeat it in all my controllers! What are the (good) solutions for this? Please help.
[eluser]Grahack[/eluser]
You can create a base controller with common vars and functions. All your controllers will inherit from it. In application/libraries/MY_Controller.php Code: <?php In application/controllers/product.php Code: <?php Have a try and keep us updated. |
Welcome Guest, Not a member yet? Register Sign In |