Comments (4)
Hey del42rus,
but this don't fix the problem, because after adding controller and route to module.config.php, the view stops with an Exception during loading the view phtml script.
The strtolower($name) is not the complete working way i think, because the path looking for phtml script is $path/module/$name/view/name-of-the-module (comes here from NameOfTheModule).
best regards
mludewig
from zftool.
Hi mludewig,
thanks for answer, you are right, the strtolower($name) is not enough to fix problem.
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
$inflectedModuleName = strtolower($filter->filter($name));
mkdir("$path/module/$name/view/" . $inflectedModuleNameName);
In controllerAction I've changed
$dir = $path . "/module/$module/view/" . strtolower($module) . "/" . strtolower($name);
to
$filter = new CamelCaseToDashFilter();
$inflectedModuleName = strtolower($filter->filter($module));
$dir = $path . "/module/$module/view/" . strtolower($inflectedModuleName) . "/" . strtolower($name);
It seems to work fine:)
best regards
del42rus
from zftool.
@del42rus Would you be willing to create a pull request with these changes?
from zftool.
@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).
So we'll have exception during loading the view phtml script.
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
from zftool.
Related Issues (20)
- No namespace in module config file after creation
- zftool.phar: command not found HOT 3
- Can't install using composer HOT 7
- Create action doesn't work HOT 2
- Enable Travis-ci service HOT 2
- Enable phpcs
- Add documentation about json response in diagnostics
- Controller creation fails when directory is missing
- Error on display config list HOT 2
- create Action fails when using project path
- ZFTool keeps saying it has thrown an exception when no exception is listed. HOT 2
- Create classmap on Windows OS HOT 2
- Zend 3 compatible? HOT 8
- zf.php version not showing version
- unable to find download link of zftool.phar HOT 1
- fail run zftool after phar create HOT 3
- zftool config list seems to be executing MVC code...
- What is the license of this project? HOT 2
- Error install composer HOT 8
- Default loading page does not load Zend framework 3 .
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zftool.