Home Backend Development PHP Tutorial action 中的数据怎么共享

action 中的数据怎么共享

Jun 13, 2016 pm 01:51 PM
action controller registry zend

action 中的数据如何共享
代码中在一个Controller内,包含多个action,我想在一个action中设置相关变量,供另外一个action读取使用,请问如何操作。

class IndexController extends Zend_Controller_Action {
public function indexAction() {
if (Zend_Registry::isRegistered('adminLoginError')) {
$adminLoginError = Zend_Registry::get('adminLoginError');
} else {
$adminLoginError = $username." 欢迎您访问我的网站";
}
}
public function testAction() {
Zend_Registry::set('adminLoginError','abc');
$this->_redirect('/index');
}
}
上面的代码,在使用中就获取不到,请高人们帮我解答下。谢谢了

------解决方案--------------------
这个问题比较复杂,邮件联系我吧 cckk263@163.com

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

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.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

How to solve the problem that SpringBoot cannot scan the Controller How to solve the problem that SpringBoot cannot scan the Controller May 14, 2023 am 08:10 AM

When a SpringBoot novice creates a project, the Controller cannot be scanned for a series of problems 1.2.3.4.5.6. Another way is to add @ComponentScan(basePackages={"xxx.xxx.xx","xxx.xxx" when starting the service class) .xx”}) is the fully qualified name of the package, which can be used for multiple SpringBoot custom controllers. The SpringBoot custom controller route cannot be scanned and cannot be found because the startup class and the custom Controller package are not in the same directory. Officially recommended placement of application.java

DJI Osmo Action 5 Pro: Release date mooted as retailer reveals launch pricing that could undercut GoPro Hero 13 Black DJI Osmo Action 5 Pro: Release date mooted as retailer reveals launch pricing that could undercut GoPro Hero 13 Black Sep 04, 2024 am 06:51 AM

DJI has not confirmed any plans to introduce a new action camera yet. Instead, it seems that GoPro will get ahead of its rival this year, having teased that it will introduce two new action cameras on September 4. For context, these are expected to a

The operation process of closing the registry process in WIN10 The operation process of closing the registry process in WIN10 Mar 27, 2024 pm 05:51 PM

1. Press and hold the [Win+R] shortcut key combination on the keyboard, open the [Run] dialogue command window, enter the [services.msc] command, and click [OK];. 2. After opening the service interface, find the [RemoteRegistry] option, and double-click with the left button to open its properties dialog window. 3. In the [RemoteRegistry Properties] dialog window that opens, select the [Disabled] option in the startup type option, and then click the [Apply]--[Stop]--[OK] button to save the settings.

How to add URL prefix to SpringBoot multiple controllers How to add URL prefix to SpringBoot multiple controllers May 12, 2023 pm 06:37 PM

Preface In some cases, the prefixes in the service controller are consistent. For example, the prefix of all URLs is /context-path/api/v1, and a unified prefix needs to be added to some URLs. The conceivable solution is to modify the context-path of the service and add api/v1 to the context-path. Modifying the global prefix can solve the above problem, but there are disadvantages. If the URL has multiple prefixes, for example, some URLs require prefixes. If it is api/v2, it cannot be distinguished. If you do not want to add api/v1 to some static resources in the service, it cannot be distinguished. The following uses custom annotations to uniformly add certain URL prefixes. one,

How to use ACL (Access Control List) for permission control in Zend Framework How to use ACL (Access Control List) for permission control in Zend Framework Jul 29, 2023 am 09:24 AM

How to use ACL (AccessControlList) for permission control in Zend Framework Introduction: In a web application, permission control is a crucial function. It ensures that users can only access the pages and features they are authorized to access and prevents unauthorized access. The Zend framework provides a convenient way to implement permission control, using the ACL (AccessControlList) component. This article will introduce how to use ACL in Zend Framework

PHP Implementation Framework: Zend Framework Getting Started Tutorial PHP Implementation Framework: Zend Framework Getting Started Tutorial Jun 19, 2023 am 08:09 AM

PHP implementation framework: ZendFramework introductory tutorial ZendFramework is an open source website framework developed by PHP and is currently maintained by ZendTechnologies. ZendFramework adopts the MVC design pattern and provides a series of reusable code libraries to serve the implementation of Web2.0 applications and Web Serve. ZendFramework is very popular and respected by PHP developers and has a wide range of

How to configure the Window2003 IIS+MySQL+PHP+Zend environment How to configure the Window2003 IIS+MySQL+PHP+Zend environment Jun 02, 2023 pm 09:56 PM

The Windows 2003 installation package includes Zend, PHP5.2.17, PHPWind8.7 and PHPMyadmin3.5.2. You can download the installation package directly to save time searching for resources. However, since MySQL has exceeded the upload limit, you need to go to the MySQL official website to download. Then unzip and copy to the D drive, as shown below: MySQLinDdisk Install and configure WindowsIIS+FTP Click Start>Control Panel>Add or Remove Programs.AddingordeletingaPG Click Add/Remove Windows Components (A). Addingorde

New DJI Osmo action camera spotted before probable summer 2024 launch to rival recent GoPro and Insta360 releases New DJI Osmo action camera spotted before probable summer 2024 launch to rival recent GoPro and Insta360 releases Jul 01, 2024 am 09:49 AM

Almost a year has passed since DJI released the Osmo Action 4 (curr. $299 on Amazon). Since then, the company has focused on its other divisions, including new RS camera gimbals. On top of that, it has introduced various drones as well like the Avata

See all articles