A
A
arab7892015-04-01 11:16:46
Yii
arab789, 2015-04-01 11:16:46

Where do you get access to $this->config?

I installed the Yii 1.1 module: comments-module , did everything according to the instructions, and when adding comments, an error occurs: Undefined index: orderComments. Looking for where this variable is, it is in Comment.php and there is a check:

if($this->config['orderComments'] === 'ASC' || $this->config['orderComments'] === 'DESC')

These variables are set in the config file:
//order direction for comments
'orderComments'=>'DESC',

It turns out there is no access to them, but I do not understand why. In the form I display the widget as in the instructions:
$this->widget('comments.widgets.ECommentsListWidget', array(
    'model' => $model,
));

In the model, the page model. Maybe it's in the model and you need to make a connection with the comment table? But nothing is written about it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Dozhdikov, 2015-04-02
@arab789

www.yiiframework.com/doc/guide/1.1/en/basics.module
Try this:
Yii::app()->controller->module->orderComments;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question