开发者

Obtaining POST variables in a template of eZ Publish

开发者 https://www.devze.com 2022-12-20 09:01 出处:网络
开发者_JAVA技巧I have a form in a template (not a eZ generated form) which posts to another eZ page. How do I get the POST variables within the template?

开发者_JAVA技巧I have a form in a template (not a eZ generated form) which posts to another eZ page. How do I get the POST variables within the template?

Thanks.


You can get it like this :

ezhttp('my_variable_name', 'POST')

You can also retrieve get and session variables like this.

You can check the documentation page.


Proper way to build form form handling in EZ Publish is create form like this:

<form method="post" action={"content/action"|ezurl}>
    <input type="hidden" name="DestinationURL" value="{$node.url_alias}" />
    <input name="(your_parameter_name)" type="text" value="parameter value">

Where $node.url_alias alias url of current node. But you can change it on whatever you need. I am not sure if input name which you wnat as parameter to your view have to be in () but it works for me. If you do it like this, in target node template are your parameters avilable through $view_parameters object.

$view_parameters.<name of your form field>
0

精彩评论

暂无评论...
验证码 换一张
取 消