I’ve read through a few different wikis and forum posts about this topic, but I can’t get my CAction to call!
So far I’ve gone through these three articles and I still can’t get it to work!
From what I’ve read, this is how I should set things up:
Controller:
public function actions()
{
// return external action classes, e.g.:
return array(
'image.'=>'ext.cmin.widgets.CMinImageLoader',
);
}
Widget:
// add the ReportImage action into the widget
public static function actions()
{
return array(
'GetReportImage'=>'application.components.actions.GetReportImage',
);
}
I’ve got a file called getReportImage.php in my components/actions folder for the CAction.
View:
<?php $this->widget('cmin.widgets.CMinImageLoader', array(
'actionPrefix'=>'image.',
'id'=>$imageWidgetID,
)); ?>
When I use the code as displayed, I get a 404 error that the image action can’t be found.
If I drop the . (which should change things from an action provider to an action class) then I get a 500 error that CMinImageLoader doesn’t have a method “runWithParameters”.
I’m using clean URLs, could that be causing the problem? Do I need to add some sort of routing rules to my urlManager?