-
Notifications
You must be signed in to change notification settings - Fork 152
/
output-add-rewrite-var.xml
executable file
·193 lines (178 loc) · 5.67 KB
/
output-add-rewrite-var.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: b0d9505811e05bc11b58ef23167f3855c742edba Maintainer: jpauli Status: ready -->
<!-- Reviewed: no -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.output-add-rewrite-var">
<refnamediv>
<refname>output_add_rewrite_var</refname>
<refpurpose>Ajoute une règle de réécriture d'URL</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>output_add_rewrite_var</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
<methodparam><type>string</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Cette fonction démarre le gestionnaire de tampon de sortie <literal>'URL-Rewriter'</literal>
s'il n'est pas actif,
stocke les paramètres <parameter>name</parameter> et <parameter>value</parameter>,
et lorsque le tampon est vidé, réécrit les <acronym>URL</acronym>s
et les formulaires en fonction des paramètres <acronym>ini</acronym> applicables.
Les appels ultérieurs à cette fonction stockeront toutes les paires nom/valeur
supplémentaires jusqu'à ce que le gestionnaire soit désactivé.
</para>
<para>
Lorsque le tampon de sortie est vidé
(en appelant <function>ob_flush</function>, <function>ob_end_flush</function>,
<function>ob_get_flush</function> ou à la fin du script),
le gestionnaire <literal>'URL-Rewriter'</literal> ajoute les paires nom/valeur
en tant que paramètres de requête aux <acronym>URL</acronym>s dans les attributs des balises HTML
et ajoute des champs cachés aux formulaires en fonction des valeurs des
directives de configuration <link linkend="ini.url-rewriter.tags">url_rewriter.tags</link> et
<link linkend="ini.url-rewriter.hosts">url_rewriter.hosts</link>.
</para>
<para>
Chaque paire nom/valeur ajoutée au gestionnaire <literal>'URL-Rewriter'</literal>
est ajoutée aux <acronym>URL</acronym>s et/ou formulaires
même si cela résulte en des paramètres de requête d'<acronym>URL</acronym> dupliqués
ou des éléments avec les mêmes attributs de nom.
</para>
<note>
<simpara>
Une fois que le gestionnaire <literal>'URL-Rewriter'</literal> a été désactivé,
il ne peut pas être redémarré.
</simpara>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>
Le nom de la variable.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
La valeur de la variable.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>7.1.0</entry>
<entry>
À partir de PHP 7.1.0, un tampon de sortie dédié est utilisé,
<link linkend="ini.url-rewriter.tags">url_rewriter.tags</link>
est utilisé uniquement pour les fonctions de sortie et
<link linkend="ini.url-rewriter.tags">url_rewriter.hosts</link> est disponible.
Antérieur à PHP 7.1.0, les variables de réécriture définies par <function>output_add_rewrite_var</function>
partageaient un tampon de sortie avec la prise en charge transparente de l'ID de session
(voir <link linkend="ini.session.trans-sid-tags">session.trans_sid_tags</link>).
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Exemple avec <function>output_add_rewrite_var</function></title>
<programlisting role="php">
<![CDATA[
<?php
ini_set('url_rewriter.tags', 'a=href,form=');
output_add_rewrite_var('var', 'value');
// Quelques liens
echo '<a href="file.php">link</a>
<a href="http://example.com">link2</a>';
// un formulaire
echo '<form action="script.php" method="post">
<input type="text" name="var2" />
</form>';
print_r(ob_list_handlers());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
<a href="file.php?var=value">link</a>
<a href="http://example.com">link2</a>
<form action="script.php" method="post">
<input type="hidden" name="var" value="value" />
<input type="text" name="var2" />
</form>
Array
(
[0] => URL-Rewriter
)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>output_reset_rewrite_vars</function></member>
<member><function>ob_flush</function></member>
<member><function>ob_list_handlers</function></member>
<member><link linkend="ini.url-rewriter.tags">url_rewriter.tags</link></member>
<member><link linkend="ini.url-rewriter.hosts">url_rewriter.hosts</link></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->