2

I am new to Zend Framework and also to Zend tools.

I have two questions regarding Zend tools.

Does anyone have any links for a detailed list of all the commands in Zend tools? I cannot seem to find anything?

For example: if I want to use the tool to create a controller in my modules directory as opposed to the controllers directory - how do I use the tool to do that? I tried to do the following but it did not work:

in my 'command prompt' I navigate to the site I am working in, I then navigated to the directory for modules; from there, I tried to create a controller for that directory i.e:

c:\theproject\application\modules\forms\controllers>zf create controller enquiry  action products  module  forms

ZF gave the following error message: unknown argument left on the command line: module

However, when I tried to create the controller without the argument n the left, the ZF created the controller in the controllers directory.

SECONDLY

I want to use the Zend tool to delete pages that have already been created. I cannot seem to find the Zend tool command for that.

THIRDLY

I want to just create a normal page view. i.e page.phtml

I cannot seem to find the command for how to creating a normal page and to also specify what directory it will go in.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
andreea115
  • 289
  • 1
  • 3
  • 14
  • What version of Zend Framework are you using? Here is the docs for ZF2.2 http://framework.zend.com/manual/2.2/en/modules/zendtool.introduction.html – Eddie Jaoude Jun 11 '13 at 16:34
  • but even this version that you showed in teh link does not give a full list of the commands. for example, it does nto give the command for deleting a file or a command to show how to create a controller in a specific directory – andreea115 Jun 11 '13 at 16:54
  • To be honest, in my opinion, I think it is better to create the files/folders manually. In ZF1.12 from the docs there does not appear to be a delete, however, check the code many times there is more functionality than documented http://framework.zend.com/manual/1.12/en/zend.tool.project.providers.html – Eddie Jaoude Jun 11 '13 at 17:40
  • If you are creating a new project, I recommend using ZF2 – Eddie Jaoude Jun 12 '13 at 05:07

2 Answers2

2

Module

  • zf create module name

Form

  • zf enable form module
  • zf create form name module

Layout

  • zf enable layout
  • zf disable layout

DbAdapter

  • zf configure db-adapter dsn section-name[=production]

DbTable

  • zf create db-table name actual-table-name module force-overwrite

Note: There are specialties, use zf create db-table.? to get specifi them.

ProjectProvider

  • zf create project-provider name actions

    :\xampp\htdocs\ZendFramework\rac>

Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
0

From the root of your project type zf

You will get the list of commands it is having. Something like

Zend Framework Command Line Console Tool v1.11.11
Usage:
    zf [--global-opts] action-name [--action-opts] provider-name [--provider-opts] [provider parameters ...]
    Note: You may use "?" in any place of the above usage string to ask for more specific help information.
    Example: "zf ? version" will list all available actions for the version provider.

Providers and their actions:
  Version
    zf show version mode[=mini] name-included[=1]
    Note: There are specialties, use zf show version.? to get specific help on them.

  Config
    zf create config
    zf show config
    zf enable config
    Note: There are specialties, use zf enable config.? to get specific help on them.
    zf disable config
    Note: There are specialties, use zf disable config.? to get specific help on them.

  Phpinfo
    zf show phpinfo

  Manifest
    zf show manifest

  Profile
    zf show profile

  Project
    zf create project path name-of-profile file-of-profile
    zf show project
    Note: There are specialties, use zf show project.? to get specific help on them.

  Application
    zf change application.class-name-prefix class-name-prefix

  Model
    zf create model name module

  View
    zf create view controller-name action-name-or-simple-name module

  Controller
    zf create controller name index-action-included[=1] module

  Action
    zf create action name controller-name[=Index] view-included[=1] module

  Module
    zf create module name

  Form
    zf enable form module
    zf create form name module

  Layout
    zf enable layout
    zf disable layout

  DbAdapter
    zf configure db-adapter dsn section-name[=production]

  DbTable
    zf create db-table name actual-table-name module force-overwrite
    Note: There are specialties, use zf create db-table.? to get specific help on them.

  ProjectProvider
    zf create project-provider name actions

Then try zf --help command for more help on the command

The command to create a controller in modules directory is

zf create controller <Controllername> 1 <module-name>

and for more try it on a sample project.

Hari K T
  • 4,174
  • 3
  • 32
  • 51
  • hello Hari. thank you so much for yoru guidance. i will try it. 2 questions: in your example, do i also include the bracesa i.e: <> . also, what does the '1' mean. is is necessary to also include that? finally. is their a command for delete. i.e to delete a previous file? – andreea115 Jun 12 '13 at 10:20
  • you don't need to use `<>`. About the 1 it is whether you need to have an `index` action by default for the controller. Please read the help message. – Hari K T Jun 13 '13 at 08:29
  • there is no delete functionality I know. use `rm` google if you don't know the command ;) . – Hari K T Jun 13 '13 at 08:29