Details
Description
Im trying to create a action in IndexController via zf.bat - but somehow it doesnt work.
It works fine when I create actions in an another controller.
The project is created with
d:\path\to\zf.bat create project . (from the directory where I want it to be created)
Worked perfectly.
Then I
copied zf.bat and zf.php to the directory (so I didnt have to type d:/path/to/zf.bat anymore.
Now I created a new controller, and added some actions with
zf.bat create controller User
zf.bat create action login User
zf.bat create action logout User
(and some more)
Then I tried to create some new actions in indexController
zf.bat create action send Index
Then this error came
PHP Fatal error: Call to a member function search() on a non-object in ...\Zend\Tool\Project\Provider\Action.php on line 85
Fatal error: Call to a member function search() on a non-object in ...\Zend\Tool\Project\Provider\Action.php on line 85
Then I tried to create another action with a name which worked perfectly in my userController
zf.bat create action login Index
same error
Hi. This behaviour occurs when you're trying to add an action to unknown controller.
Try to use this command (with small I letter in controller name):
zf.bat create action send index
It should work.
My bugtrack:
Zend_Tool_Project_Provider_Action::hasResource()
contains :
$controllerFile = self::_getControllerFileResource($profile, $controllerName, $moduleName);
now, when you specify unknown controller, it returns false, as defined in Zend_Tool_Project_Profile_Resource_Container::find(). It should definitely either throw a warning, if the $controllerFile === false saying it's case sensitive, maybe explain it a little bit. Maybe it could be good to try to lower the first letter in the find() function before giving up the controller search...