Home > centOS, Fedora 12, PHP, Unix/Linux, Zend > Zend controller

Zend controller

How to zend controller?

1. by doing this > we are adding three controller

zf create action add index == create as new/check/alert > addAction() { } to controller name “IndexController.php”


Practical: Steps:
[root@www myzf]# zf create action add index

Note: The canonical controller name that is used with other providers is “Index”; not “index” as supplied

Creating an action named add inside controller at /var/www/html/myzf/application/controllers/IndexController.php

Updating project profile ‘/var/www/html/myzf/.zfproject.xml’

Creating a view script for the add action method at /var/www/html/myzf/application/views/scripts/index/add.phtml

Updating project profile ‘/var/www/html/myzf/.zfproject.xml’

[root@www myzf]# zf create action add Index

An Error Has Occurred

This controller (Index) already has an action named (add)

Zend Framework Command Line Console Tool v1.10.1

Details for action “Create” and provider “Action”

Action

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

[root@www myzf]# zf create action edit Index

Creating an action named edit inside controller at /var/www/html/myzf/application/controllers/IndexController.php

Updating project profile ‘/var/www/html/myzf/.zfproject.xml’

Creating a view script for the edit action method at /var/www/html/myzf/application/views/scripts/index/edit.phtml

Updating project profile ‘/var/www/html/myzf/.zfproject.xml’

[root@www myzf]# zf create action del Index

Creating an action named del inside controller at /var/www/html/myzf/application/controllers/IndexController.php

Updating project profile ‘/var/www/html/myzf/.zfproject.xml’

Creating a view script for the del action method at /var/www/html/myzf/application/views/scripts/index/del.phtml

Updating project profile ‘/var/www/html/myzf/.zfproject.xml’

a. visit: http://localhost/myzf/public/index/add

path: application/controllers/IndexController.php::addAction() { }
output: View script for controller Index and script/action name add

b. visit: http://localhost/myzf/public/index/edit

path: application/controllers/IndexController.php::editAction() { }
output: View script for controller Index and script/action name edit

c. visit: http://localhost/myzf/public/index/del

path: application/controllers/IndexController.php::delAction() { }
output: View script for controller Index and script/action name del

Advertisements
Categories: centOS, Fedora 12, PHP, Unix/Linux, Zend
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: