A
A
akula222016-01-18 19:40:58
Yii
akula22, 2016-01-18 19:40:58

How to get properties from a Module?

Module.php file

<?php
namespace app\modules\user;
class Module extends \yii\base\Module
{
    public $controllerNamespace = 'app\modules\user\controllers';

    public $emailConfirm = true;

in the model you need to get emailConfirm
<?php
namespace app\modules\user\models;
use Yii;
use yii\base\Model;
use app\modules\user\Module;
....
   public function signup()
    {
        echo $this->module->emailConfirm; die();

gives error Getting unknown property: app\modules\user\models\SignupForm::module
why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita, 2016-01-18
@akula22

Because you're calling $thison the model, it doesn't have a property $moduleand it's spelled human in the error.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question