Hi all,
I found the yii framework three months ago, and I must say it has been a pleasure to work with, not only for it’s power and ease of use, but for it’s community.
Recently, I started my first serious project with yii, and I’m facing a problem I could not solve.
I’ve created a portlet, and have located it in /protected/components. The portlet is named “Apercibimientos”.
Then in a view I use:
<?php
$this->widget('Apercibimientos');
?>
Everything works great when I’m in my local environment, but when the code runs on the server, and visit the corresponding action, I get a generic error “500 Internal Server Error”.
The funny thing is, that if instead of calling the portlet, in the view I use the following:
<?php
$this->beginWidget('zii.widgets.CPortlet', array(
'title'=>'Apercibimientos',
'titleCssClass'=>''
));
?>
<?php // here I put the code that renders the content ?>
<?php $this->endWidget() ?>
Then it works as expected.
First I thought it would be a problem caused by using a class that extends CPortlet, so I changed "Apercibimientos" to be a simple class. Then in my controller I used:
$apercibimientos = new Apercibimientos();
$this->render('dashboard', array('apercibimientos'=>$apercibimientos));
And in my view:
<?php
$this->beginWidget('zii.widgets.CPortlet', array(
'title'=>'Apercibimientos',
'titleCssClass'=>''
));
?>
<?php $apercibimientos->renderContent(); ?>
<?php $this->endWidget() ?>
Again, it worked locally but not in the production server.
The only thing I can think that is different on the server, is that modrewrite is not enabled and AllowOverride is set to none, so the .htaccess file is being ignored (I have no access to change this).
Any help would be greatly appreciated.
Thanks, Victor.