How to use view to load a CSS file |
(05-21-2018, 05:46 AM)kilishan Wrote: Your error states Argument 3 passed to view() must be of the type array, boolean given. A look at the code for the view() function shows it's looking for an $options array, which really only has one valid value at the moment: 'saveData'. Where in the manual is it stating to pass a true/false as the third parameter? We need to update that if you can show us where. From the Online Manual: /* Maybe incorrect Boolean $saveData - should be array['save'=true]; ? */ https://bcit-ci.github.io/CodeIgniter4/g...t=savedata $data = [ 'title' => 'My title', 'heading' => 'My Heading', 'message' => 'My Message' ]; echo view('blogview', $data, ['saveData' => true]); Additionally, if you would like the default functionality of the view method to be that it does save the data between calls, you can set $saveData to true in application/Config/Views.php. /* Uses Boolean */ https://bcit-ci.github.io/CodeIgniter4/g...t=savedata CodeIgniter\View\Parser render($view[, $options[, $saveData=false]]]) /* Uses Boolean */ https://bcit-ci.github.io/CodeIgniter4/g...t=savedata CodeIgniter\View\View render($view[, $options[, $saveData=false]]]) Parameters: $view (string) – File name of the view source $options (array) – Array of options, as key/value pairs $saveData (boolean) – If true, will save data for use with any other calls, if false, will clean the data after rendering the view. /* Uses Boolean */ https://bcit-ci.github.io/CodeIgniter4/g...t=savedata renderString($view[, $options[, $saveData=false]]]) Parameters: $view (string) – Contents of the view to render, for instance content retrieved from a database $options (array) – Array of options, as key/value pairs $saveData (boolean) – If true, will save data for use with any other calls, if false, will clean the data after rendering the view. //================================================ I managed to solve the problem of using View to load a CSS file: CodeIgniter\View\View::render ==> Line: 170 PHP Code: # echo __method__ .' ==> Line: ' .__line__ ;die; |
Messages In This Thread |
How to use view to load a CSS file - by John_Betong - 05-19-2018, 09:05 PM
RE: How to use view to load a CSS file - by ciadmin - 05-19-2018, 09:27 PM
RE: How to use view to load a CSS file - by John_Betong - 05-20-2018, 10:04 PM
RE: How to use view to load a CSS file - by kilishan - 05-21-2018, 05:46 AM
RE: How to use view to load a CSS file - by John_Betong - 05-21-2018, 08:59 AM
|