It wouldn't be so hard to implement if you really want to...
Something like this would feat both for internal forwarding and redirection:
protected $_internalParamsStorage = null;
protected function setInternalParam($name, $value) {
if (null === $this->_internalParamsStorage= {
$this->_internalParamsStorage = new
Zend_Session_Namespace('zend_controller_action_internal_params_storage');
}
$this->_internalParamStorage->$name = $value;
}
protected function getInternalParam($name) {
if (null === $this->_internalParamsStorage= {
$this->_internalParamsStorage = new
Zend_Session_Namespace('zend_controller_action_internal_params_storage');
}
return $this->_internalParamStorage->$name;
}
You must be aware that storage will be shared between ALL your actions
controllers... You can "restrain" it by defining a namespace with your
controller name, for example, event if it's not really sure (namespace
can be accessed "manually"). I don't think it's a good idea but if
you're using feature like this really often...
Hope this can help.
Lucas
Alex a écrit :
Any other solution?
How about something like $this->_setInternalParam() and
$this->_getInternalParam()
Would that be hard to implement?
On Thu, Feb 19, 2009 at 12:07 PM, Ben Scholzen 'DASPRiD'
<[email protected] <mailto:[email protected]>> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Disable the default route, and only use custom routes.
...................................
: ___ _ ___ ___ ___ _ ___ :
: | \ /_\ / __| _ \ _ (_) \ :
: | |) / _ \\__ \ _/ / | |) | :
: |___/_/:\_\___/_| |_|_\_|___/ :
:........:........................:
: Web : http://www.dasprids.de :
: E-mail : [email protected] <mailto:[email protected]> :
: Jabber : [email protected] <mailto:[email protected]> :
: ICQ : 105677955 :
:........:........................:
Alex schrieb:
> Hi Ben,
>
> Well, $this->_setParam() almost suits me perfectly. Here's
the problem.
>
> Action1:
> _setParam('secret', 'somevalue')
> _forward('action2)
>
> Action2:
> _getParam('secret')
>
> But how do I make it so that 'secret' cannot be a
usersupplied parameter?
>
> - Alex
>
>
> On Thu, Feb 19, 2009 at 10:02 AM, Ben Scholzen 'DASPRiD'
> <[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>> wrote:
>
> That really depends. The easiest thing would be to store the
value in a
> session, and if required give the user an hashed identifier
as parameter
> to identify the data. If the data should be long-term
persistent or for
> multiple users, store the data in a database.
> ...................................
> : ___ _ ___ ___ ___ _ ___ :
> : | \ /_\ / __| _ \ _ (_) \ :
> : | |) / _ \\__ \ _/ / | |) | :
> : |___/_/:\_\___/_| |_|_\_|___/ :
> :........:........................:
> : Web : http://www.dasprids.de :
> : E-mail : [email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>> :
> : Jabber : [email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>> :
> : ICQ : 105677955 :
> :........:........................:
>
>
> Alex schrieb:
>> How can I pass a parameter between two actions, but making
it so the
>> second action cannot receive said parameter directly from
the user?
>
>> - alex (from iphone)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmddaAACgkQ0HfT5Ws789BcDQCgw3bR3Y6igcjNOjF/+Ez8KxyA
5j8AoNLINOw+tKAH01MZddSW+tZzuWla
=JxBh
-----END PGP SIGNATURE-----