-
Notifications
You must be signed in to change notification settings - Fork 102
Can't create index.phtml when creating controller #65
Comments
Hey del42rus, best regards |
Hi mludewig, So now I've used CamelCaseToDash filter for building properly path to phtml script. For that it was necessary to change moduleAction and controllerAction in ZFTool\Controller\CreateController class. In moduleAction I've added following code after all other mkdir functions: $filter = new CamelCaseToDashFilter(); // include Zend\Filter\Word\CamelCaseToDash class in use section In controllerAction I've changed to It seems to work fine:) best regards |
@del42rus Would you be willing to create a pull request with these changes? |
@weierophinney As I can see you have already added recursive flag in mkdir calls. And I've noticed that $viewfolder = strtolower($name). As @mludewig mentioned above the strtolower($name) is not the complete working way, because the path looking for phtml script is $path/module/$name/view/name-of-the-module (comes here from NameOfTheModule). I've changed code a little bit by adding CamelCaseToDash filter and using it for building properly path to phtml script. Also I've created pull request with these changes |
[#65] Use CamelCaseToDash filter for building properly path to phtml script
When I try create controller with command zf.php create controller I get following errors
Warning: mkdir(): No such file or directory in C:\OpenServer\domains\zf2.local\ZendSkeletonApplication\vendor\zftool\src\ZFTool\Controller\CreateController.php on line 142
Warning: file_put_contents(./module/test/view/test/index/index.phtml): failed to open stream: No such file or directory in C:\OpenServer\domains\zf2.local\ZendSkeletonApplicatio
n\vendor\zftool\src\ZFTool\Controller\CreateController.php on line 147
There was an error during controller creation.
I've fixed this by adding following string in moduleAction method in ZFTool\Controller\CreateController class:
mkdir("$path/module/$name/view/" . strtolower($name));
The text was updated successfully, but these errors were encountered: