Yii Framework Forum: How To Get Message About Error If I Don't Set Any Variable In View? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Get Message About Error If I Don't Set Any Variable In View? Rate Topic: -----

#1 User is offline   egorpromo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 66
  • Joined: 02-December 12

Posted 02 February 2013 - 10:39 AM

Hi!
I create any view and use it in controller this way:
$this->render('myview', array(
    'var1'=>$value1,
    'var2'=>$value2
));


View has code with usage $var1 and $var2 variables:
<h1>It is my view</h1>
echo $var1.'<br />'.$var2;


I want if I don't set any variable in my view I have received error or notice message from yii framework. For example if I render my view the way without setting variables like that:
$this->render('myview')

i want to get error mesage.
Now I can't do that. I set define('YII_DEBUG',TRUE) in YiiBase.php file and it have not helped me.
How to do that?
Thanks.
0

#2 User is offline   Luke Jurgs 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 16-October 11
  • Location:Australia

Posted 02 February 2013 - 06:40 PM

Turn on E_STRICT:

PHP Error Reporting

Should sort it out for you.

View Postegorpromo, on 02 February 2013 - 10:39 AM, said:

Hi!
I create any view and use it in controller this way:
$this->render('myview', array(
    'var1'=>$value1,
    'var2'=>$value2
));


View has code with usage $var1 and $var2 variables:
<h1>It is my view</h1>
echo $var1.'<br />'.$var2;


I want if I don't set any variable in my view I have received error or notice message from yii framework. For example if I render my view the way without setting variables like that:
$this->render('myview')

i want to get error mesage.
Now I can't do that. I set define('YII_DEBUG',TRUE) in YiiBase.php file and it have not helped me.
How to do that?
Thanks.

1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users