Welcome Guest, Not a member yet? Register   Sign In
configuration files as array?
#1

(This post was last modified: 02-01-2022, 03:12 AM by dumefuko.)

I am passing some environment settings to a view template but how do I pass it as an Array to avoid below error?

TypeError
Argument 2 passed to view() must be of the type array, object given





PHP Code:
<?php namespace Config;

use 
CodeIgniter\Config\BaseConfig;

class 
TestConfig extends BaseConfig
{
    /*
    |--------------------------------------------------------------------------
    | CAPTCHA
    |--------------------------------------------------------------------------
    |
     */
    public $captcha 1


PHP Code:
// Access config class with namespace
$config config'Config\\TestConfig' );

echo 
view('login'$config); 
"Where are you going?" Chad hollered at her, "Come strip and dance for me. I'm going to need some motivation if I'm going to fuck this fag." Motivation, what a joke, Candy thought. Chad was already rock hard and dripping pre-cum. What a fucking homo. Still not wanting to get beat, Candy rejoined the group.

Pulling her floppy tits over the bust line of her dress, Candy began to sway to imaginary music. She turned around and lifted her dress and began to twerk. Her fat ass tightened as she bent over. Her cellulite dimples smoothing out making her ass seem a little less revolting as it bounced. Looking back at Chad, Candy realized he wasn't even paying attention to her. His eyes were fixed on the little fag boy in front of him. Unbelievable, Candy thought as she stopped and sat down on a chair by the bed. She couldn't believe that Chad was so into this guy.

By this point Will had been pushed to his knees in front of Chad. Chad's erection was right in front of Will's nose. It stank. Will was already gagging and the cock wasn't even in his mouth. Reaching into his purse, he pulled out a baby wipe and wiped down the narrow shaft. Next he worked on cleaning the bulbous mushroom tip. It looked comically large on the slender shaft, almost like an open umbrella. Will looked at the baby wipe it was dark brown with some yellow crust... maybe another wipe down with a fresh wipe, Will thought.

"Quit, playing around and stick it in your mouth slut!" Chad commanded. "You can clean it with your tongue, I haven't got all day, Candy needs to get back to work."

https://pornpics.love/
https://livesexcam.tv/
https://liveporn.love/
Reply
#2

(This post was last modified: 10-22-2020, 07:55 AM by T.O.M..)

config('Config\TestConfig') returns instance of Config class. You cannot convert it to array as you want.

You may make your own array variable with needed keys and pass it to view call:
PHP Code:
$config config('Config\TestConfig');

$data = [
   'captcha' => $config->captcha
];

echo 
view('login'$data); 
Reply
#3

use get_object_vars();

echo view('login', get_object_vars($config));
Reply




Theme © iAndrew 2016 - Forum software by © MyBB