How to create controller using command prompt in zend framework - zend-framework

I am new to zend framework.I have placed my bin and library folder in :
C:\xampp\htdocs\zend
and have created project using command prompt.
C:\xampp\htdocs\zend\bin> zf create project zendtest
its creating project zendtest in folder -> C:\xampp\htdocs\zend\bin\
C:\xampp\htdocs\zend\bin>cd zendtest
but when i tried to create module
C:\xampp\htdocs\zend\bin\zendtest> zf create module testmodule
its saying 'zf' is not recognised as internal or external command .
On creating controller also giving same error.
How to solve this issue.

You need to add it to your system's PATH. Take a look here:
http://framework.zend.com/manual/en/zend.tool.extending.html#zend.tool.extending.zend-tool-framework.cli-client.setup-windows
Should be as simple as adding the path to your Zend Framework's bin folder to the PATH, and you should be set.

First you have to go to your project path and then move to path from where your command will run
c:\xampp\htdocs\project_name>..\Zend\bin\zf.bat create module
module_name

Related

What path of PHPUnit add as Global Include Path in Netbeans?

My book tell to add PHPUnit path to Global Include Path in Netbeans, but its use out of date PEAR way.
I installed PHPUnit using composer global require "phpunit/phpunit xxx". I run this command right in c:\
I got main PHPunit directory in: C:\Users\xxx\AppData\Roaming\Composer\vendor\phpunit
and two files in:
C:\Users\xxx\AppData\Roaming\Composer\vendor\bin
It depends, on how much code-completion support you want.
If you want the code-completion to work for all globally installed Composer packages,
then the path would be
C:\Users\xxx\AppData\Roaming\Composer\vendor
When you set this "Include Path" Netbeans will automatically scan the whole vendor folder and provide completion support for all classes of all packages. Scanning might take a while...
If you want completion support only for PHPUnit, then adding
C:\Users\xxx\AppData\Roaming\Composer\vendor\phpunit
is sufficent. Only the content of the phpunit folder will be scanned.
(I use the first approach, because PHPUnit has several other dependencies/packages (e.g. phpunit-selenium) and its nice to have support for these classes, too.)
The bin folder should contain a batch file: phpunit.bat.
This script might be used in the testing/ phpunit configuration as the "PHPUnit Script". When you invoke testing, this script will be used to start the Composer installed PHPUnit (, instead of the PEAR one).

Using jniwrapper custom code in install4j installers

We have an installation script written in install4j.
Our installer needs to call custom code from the library jniwrap.dll.
We included jniwrap.dll into the install4j project and declared it in 'Installer' > 'Custom Code & Resources'.
Unfortunately the installation fails: jniwrap.dll cannot be loaded because it's not in the search path.
Do you know how the error can be fixed?
What about the jniwrapper's license file? Do we have to insert it to the install4j project, too?
Thank you in advance.
Unfortunately the installation fails: jniwrap.dll cannot be loaded because
it's not in the search path.
The parent directory of the extracted file will not be in the search path. You have to call
System.load((String)context.getVariable("sys.resourceDir")
+ File.separator + "jniwrap.dll");
to load the library.
What about the jniwrapper's license file? Do we have to insert it to the
install4j project, too?
If it needs to be in the same directory as the DLL, then yes.

Zend Framework issue in run command in netbeans

I am trying my hands on using Zend framework with netbeans.
I have setup everything correctly as i can create project using ZF command line and can create other controller and actions.
But when i setup project in netbeans and use run command it does not seems to understand Zend framework MVC url structure and shows complete path in browser.
instead of running http://testing.com/about
it is taking http://testing.com/application/controllers/AboutController.php
but when i type is manually everything seems to be working fine.
you need adjust a few settings in your project properties. Open your project properties menu and select Sources make sure your Web Root is set to public, while you're there make sure your sources and project folder are correct.
Next select Run Configuration and make sure your Project URL is correct. When using ZF there is no need to specify an index file, netbeans may complain some but it will work.
Now when want to run your project you have to run the whole project. When using ZF you can't run just one file because all request are routed through the index.php in the public folder. So Always select run at the project level and not at the file level.

Dont recognize the controller created in one Zend based project and then copy it into another Zend Project

In Zend project named pro1 I have one module named Admin.In this module I have a controller named DeliveryCentersController.Now I run this project everything is running fine.But Now I have one project pro2 .And I copy the folder Admin of pro1 to pro2 .Now In pro2 I have module named Admin which was created in pro1.Now I run zend command in pro2 to create action as
zf create action act DeliveryCenters -m Admin
But it says an error as An Error Has Occurred Controller DeliveryCenters was not found.To recognize it What should be done??Should change in application.ini file??
When I create another contoller named control in pro2 in Admin module (created in pro1 and copied in pro2) and run zend command to create action in control it runs fine.
There is a file named .zfproject.xml in the directory above application. It contains an XML-document which maps the directory structure.
You'd have to copy the moduleDirectory-XML-tag of Admin from the .zfproject.xml of Project 1 to Project 2.
You probably have to copy the folder tests/application/modules/admin from Project 1 to Project 2 too. Otherwise there's another ugly error message.

Installing Zend Framework with XAMPP

I've Xampp installed on my computer, and I want to install Zend Framework. I noticed there is already a folder called Zend inside the xampp/php/PEAR/Zend
Does it mean the Zend framework is already installed? On phpinfo, the include_path is .;C:\xampp\php\PEAR. Do I need to configure the path? What should be the new path?
Finally how can I know if the Zend framework is installed successfully and ready to use.
Thanks for any help.
Zend framework is intensively developed and i doubt that xampp package include up to date version, so I recommend you to download latest full version from http://framework.zend.com/download/latest and extract the archive somewhere else.
Zend Framework requires no special installation steps. Simply download the framework,
extract it to the folder you would like to keep it in, and add the library directory
to your PHP include_path. To use components in the extras library, add the extras/library
directory to your PHP include_path, as well.
If you would like to use Zend_Tool, simply add bin/zf.bat (for Windows) or
bin/zf.sh (for anything else) to your system executable path.
The important files of Zend framework are located in ZendFramework-1.x.x\library\Zend in the archive and the ZendX (extras) are in ZendFramework-1.x.x\extras\ZendX. You might also need the ZendFramework-1.x.x\bin folder where is the ZendFramework console tool (zf)
I prefer extracting the "ZendFramework-1.x.x\library\Zend" into a folder lib\Zend and add it to the include path in php.ini
Installing zend framework on Windows
Download zend framework.
Include the zend lib path on your php.ini file (If you have zend lib within c:wampp/www/zend/library/ then put the path in php.ini include_path="c:/wampp/www/zend/library").
In the downloaded folder there is bin folder and there is file zf.bat so open that file and put the pull path of php.exe.
Go to command prompt and go to directory where you need your project.
Run this command:
C:\\wampp\www\zend\bin\zf.bat create project project_name