Search code examples
zend-framework2zend-tool

Using ZFTool in ZF2 to create new modules


I installed the ZF2 skeleton application via composer and am learning ZF2 via the book Learn ZF2 by Slavey Karadzhov. I added the zftool dependency via composer after the skeleton was installed. I'm on Windows 8.

I've been through https://stackoverflow.com/questions/26387615/how-do-you-add-zftool-to-an-existing-zf2-project-one-not-created-with-zftool which implies a requirement for application.config.php in the top level config which I have.

I've tried to create a new module via:

path/to/project> php vendor/bin/zf.php create module Test

Which returns:

SRC_DIR="pwd"
cd "dirname "$0""
cd "../zendframework/zftool"
BIN_TARGET="pwd/zf.php"
cd "$SRC_DIR"
"$BIN_TARGET" "$@"

The above is the contents of vendor/bin/zf.php

I've seen the same question asked on other forums but lacks answers. Any help would be much appreciated.


Solution

  • On Windows OS you need to run bat file:

    path/to/project>vendor\bin\zf.php.bat
    

    or if you want to use php script, run original one from library directory:

    path/to/project>php vendor\zendframework\zftool\zf.php