Hello -
I am pretty new to yii and have made a great amount of progress looking online for help on my related issues. Now I have one that I’m sure is easy (most things are after you figure them out!).
Here is my problem -
I have a simple yii app that has no login, really when all said and done a form that gets submitted. All the code for login, and related generated code from yiic that was not needed (except error.php) was removed.
The problem is when an exception is thrown I get the 302 redirect loop that redirects back to ‘… /index.php?r=site/login’ until the browser detects the loop and kills the redirect loop.
Also in the single controller that I have I do a default page -
class SiteController extends Controller
{
public $defaultAction = 'landing';
...
Which is my main entry point to the app, Again it uses no login or related access controls. Everything is working fine other then working with exceptions.
I found this by accident by testing an ajax action that was checking that it was really an ajax request proper and tossing an exception if not,
I also have this as my action for the error if that matter (I think it was yiic generate), on an exception would like the error page to show with the message.
...
public function actionError()
{
if($error=Yii::app()->errorHandler->error)
{
if(Yii::app()->request->isAjaxRequest)
echo $error['message'];
else
$this->render('error', $error);
}
}
...
Other then that, I’m not sure why it redirects back to the login action or how to change that behavior…
Thanks for any help or guidance!
Sandy