SOLVED: Implementing action extension


I’m trying to create an action extension (to do autocompleting) for the site controller. I followed the guidelines in

I’ve added the following code to return array of the actions() function of the site controller.


I did put a php file called SAutoCompleteAction.php in directory extensions/autocomplete with a definition of the class SAutoCompleteAction and a run() function containing the actual action code.

I get the following message when calling localhost/app/index.php?r=site/autocomplete.

There’s absolutely no typing mistake made. What is wrong here? Any idea?


I believe it has something to do with the YiiBase.php code. Because the controller can’t find the action at first, extensions are searched for using the actions() function.

The appropriate extension class file is imported (using a forced require - the complete path of the extension class file is supplied) and according to the debugger this proceeds without problems. Then a new extension class instance is created which triggers the autoload function. The autoload wants to load the class file again using include($className.’.php’) and here inclusion fails because the path is unknown.

It looks like a bug. Any comment?


These kind of things happen when you forget to add <?php tags to your code :wub: