亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Home php教程 PHP開發(fā) Zend Framework Distributor Usage Example

Zend Framework Distributor Usage Example

Jan 06, 2017 am 09:49 AM

The example in this article describes the usage of Zend Framework distributor. Share it with everyone for your reference, as follows:

Distribution is to obtain the request object, extract the module name, controller name, action name and optional parameters, and then instantiate the controller and call the entire action process.

If the module, controller or action is not found, the default value will be used.

The Zend_Controller_Dispatcher_Standard class specifies that the default value of each controller and action is index, and the default value of the module is default.

This class allows developers to change the default value settings through the setDEfaultController() method, setDefaultAction() method and setDefaultModule() method.

_forward()

Function: Call this method in any action and pass in the action, controller, module and optional parameters to enter a new action.

Case:

<?php
public function fooAction(){  //定義動(dòng)作
  //轉(zhuǎn)到當(dāng)前控制器與模塊中的其他動(dòng)作中
  $this->_forward(&#39;bar&#39;,null,null,array(&#39;baz&#39;=>&#39;bogus&#39;));//第一個(gè)參數(shù),表動(dòng)作;第二個(gè)參數(shù),表控制器;第三個(gè)參數(shù)表示模塊
}
public function barAction(){  //定義動(dòng)作
  //轉(zhuǎn)到當(dāng)前模塊的其他控制器的動(dòng)作中,F(xiàn)ooController::bazAction()
  $this->_forward(&#39;baz&#39;,&#39;foo&#39;,null,array(&#39;baz&#39;=>&#39;bogus&#39;));
}
public function bazAction(){
  //轉(zhuǎn)到其他控制器、其他模塊中的動(dòng)作,F(xiàn)oo_BarController::bazAction()
  $this->_forward(&#39;baz&#39;,&#39;bar&#39;,&#39;foo&#39;,array(&#39;baz&#39;=>&#39;bogus&#39;));
}

I hope this article will be helpful to everyone’s PHP programming based on the Zend Framework framework.

For more articles related to Zend Framework distributor usage examples, please pay attention to the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1488
72