default data passed through BaseController |
Hi there...
I'm trying to do my first project with CodeIgniter 4. I want to pass standard data to View set inside the BaseController. But following code does not work: Controller (BaseController) PHP Code: public $data = [ PHP Code: public function index() I want to have default variables which I can change in the controller. Any Ideas ? Thanks, Kigh... Now it works fine, but I get an error with preloading "session": Quote:Fatal error: Uncaught ErrorException: touch(): Unable to create file NULL/ci_session7roacrtom0dsiftqc3pdd0j1jnjv6ejo because No such file or directory in C:\xampp\htdocs\kighlander.local\system\Session\Handlers\FileHandler.php:252 Stack trace: #0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'touch(): Unable...', 'C:\\xampp\\htdocs...', 252, Array) #1 C:\xampp\htdocs\kighlander.local\system\Session\Handlers\FileHandler.php(252): touch('NULL/ci_session...') #2 [internal function]: CodeIgniter\Session\Handlers\FileHandler->write('7roacrtom0dsift...', '__ci_last_regen...') #3 [internal function]: session_write_close() #4 {main} thrown in C:\xampp\htdocs\kighlander.local\system\Session\Handlers\FileHandler.php on line 252 |
Messages In This Thread |
default data passed through BaseController - by Codinglander - 03-29-2020, 05:44 AM
RE: default data passed through BaseController - by InsiteFX - 03-29-2020, 08:01 AM
RE: default data passed through BaseController - by Codinglander - 03-29-2020, 11:02 AM
|