• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing config params to the model?


I'm trying to pass in config parameters to the model on initialization. But, I can't seem to be able to do so, as I get this error:

Argument 1 passed to CodeIgniter\Model::__construct() must be an instance of CodeIgniter\Database\ConnectionInterface or null, array given, called in /Applications/MAMP/htdocs/ … /app/Controllers/Api.php on line 47

Now, what seems to be more frustrating is the fact that I have absolutely no clue WHERE to look in the docs for the syntax used to set model and pass in parameters. Now, the docs do not seem to be 'designed' for being used as a reference for situations like this. What I'm looking for is something like this:

$model = new YaddaYaddaModel( $my_config_for_the_model_here );

I've been trawling the docs for it but have had no 'luck' (yeah, that's what it actually takes ; ) ) finding it so far …

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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