A
A
Almik Oh! Give me a guitar2014-11-21 08:47:13
Yii
Almik Oh! Give me a guitar, 2014-11-21 08:47:13

Yii where to take class configs?

Hello !
Wrote an Ldap class that allows you to search the database, etc.
I placed it in the components, that is, project/components/Ldap and I can use the class anywhere. I defined all the necessary configs (password, login, ip) as private variables of the Ldap class. Is it possible to make the configs be defined in project/configs/main.php and not in the class as private variables?
Sincerely ,
Almik

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
windoctor, 2014-11-21
@windoctor

Why don't you want to create a separate config file?

E
Eugene, 2014-11-21
@Nc_Soft

Make the class as an extension and you can use
Yii::app()->ldap->....
And the config will be like this

'components' => array(
        'lpad' => array(
            'class' => 'LDap',
            'user' => '**',
           'password' => '**',
        ),
    ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question