Views/Rendering Variable Issues? |
I have a project that will be built on CI4 and I have some time to play around with it today for giggles.
I'm loosely following the Static Pages Tut and have noticed there's issues (for me) passing variables through view calls. I have a pretty good idea why this is happening and wondering if there's a workaround other than passing each expected variable through the view call. so.... I have a directory that looks like this: Code: ... in my controller, I do the usual stuff, nothing special, of calling views... Code: public function index() All goes well so far, here's where it get's a bit troublesome. In Templates/Layouts/Default/default.php Code: <!doctype html> in Templates/Partials/Default/meta.php Code: <head> One would expect the $title variable to be available as it's being called from the layout file, which has access to the $data['title'] variable but CI throws an error about the missing variable $title. I'm still getting read up on the docs, and there's not much currently available about templates/rendering/etc, so I'm relying on CI2/3 conventions for this experiment. I have read a bit about view cells, should I be using that or is CI4 just not quite up to speed on the views/rendering/etc stuff? Just to make sure I'm being fairly clear about it all, I was expecting access to all the $data passed from the controller to the view in all the Layout and Partial views. |
Messages In This Thread |
Views/Rendering Variable Issues? - by enlivenapp - 10-11-2016, 11:18 AM
RE: Views/Rendering Variable Issues? - by kilishan - 10-11-2016, 12:44 PM
RE: Views/Rendering Variable Issues? - by enlivenapp - 10-11-2016, 01:00 PM
RE: Views/Rendering Variable Issues? - by kilishan - 10-11-2016, 09:35 PM
RE: Views/Rendering Variable Issues? - by enlivenapp - 10-12-2016, 08:53 AM
RE: Views/Rendering Variable Issues? - by cartalot - 10-12-2016, 12:55 PM
RE: Views/Rendering Variable Issues? - by enlivenapp - 10-12-2016, 01:11 PM
RE: Views/Rendering Variable Issues? - by cartalot - 10-12-2016, 03:28 PM
RE: Views/Rendering Variable Issues? - by sv3tli0 - 10-11-2016, 11:09 PM
|