• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.