Welcome Guest, Not a member yet? Register   Sign In
CI4 lacks seems to lack a couple of super convenient CI3 features.
#5

Re (1), is this what you are looking for? ... you can have method scope
Code:
$app = config('App');
$app->brian = 'whatever you want';
Or, if you want to access it everywhere, give it object scope,
Code:
$this->app = config('App');
$this->app->brian = 'whatever you want';

You can access anything from application/Config/App (or whichever config file you are interested in), and you can even create config items on the fly. The pre-existing ones are supposed to be static, so instance-agnostic. If you wanted the same for yours, then add it to App similarly.


Re (2), is this what you are looking for? https://bcit-ci.github.io/CodeIgniter4/o...-reference

... specifically, the setVar and setData methods of any view or view parser.
Reply


Messages In This Thread
RE: CI4 lacks seems to lack a couple of super convenient CI3 features. - by ciadmin - 09-28-2018, 12:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB