{FR} - 3.4.3.1.1 write
write(string $key, mixed $value)
write(string $key, mixed $value)
Utilisez write() pour stocker une donnée dans la configuration de l'application.
Configure::write('Societe.nom','Pizza');
Configure::write('Societe.slogan','Pizza pour votre corps et votre âme');
Configure::write('Societe.nom','Pizza');Configure::write('Societe.slogan','Pizza pour votre corps et votre âme');
Remarquez l'utilisation de la notation avec point pour le paramètre $key. Vous pouvez utiliser cette notation pour organiser votre configuration en groupes logiques.
L'exemple ci-dessus aurait pu s'écrire aussi en un simple appel :
Configure::write(
'Societe',array('nom'=>'Pizza','slogan'=>'Pizza pour votre corps et votre âme')
);
Configure::write('Societe',array('nom'=>'Pizza','slogan'=>'Pizza pour votre corps et votre âme'));
Vous pouvez utiliser Configure::write(‘debug’, $int) pour passer du mode débug au mode production à la volée. Ceci est particulièrement pratique pour les interactions AMF ou SOAP dans lesquelles les informations de débug peuvent poser des problèmes de parsing.
{EN} - 3.4.3.1.1 write
write(string $key, mixed $value)
Use write() to store data in the application’s configuration.
Configure::write('Company.name','Pizza, Inc.');
Configure::write('Company.slogan','Pizza for your body and soul');
Configure::write('Company.name','Pizza, Inc.');Configure::write('Company.slogan','Pizza for your body and soul');
the usage of dot notation in the $key parameter. You can use this notation to organize your configuration into logical groups.
The above example could also be written in a single call:
Configure::write(
'Company',array('name'=>'Pizza, Inc.','slogan'=>'Pizza for your body and soul')
);
Configure::write('Company',array('name'=>'Pizza, Inc.','slogan'=>'Pizza for your body and soul'));
You can use Configure::write('debug', $int) to switch between debug and production modes on the fly. This is especially handy for AMF or SOAP interactions where debugging information can cause parsing problems.
Differences
| Lines: 1-15 | Lines: 1-15 | ||
| <title>write</title> | <title>write</title> | ||
| - | <p class="method"><code>write(string $key, mixed $value)</code></p> <p>Use <code>write()</code> to store data in the application’s configuration.</p> |
+ | <pre>write(string $key, mixed $value)</pre> <p>Utilisez write() pour stocker une donnée dans la configuration de l'application.</p> |
| <pre> | <pre> | ||
| - | Configure::write('Company.name','Pizza, Inc.'); Configure::write('Company.slogan','Pizza for your body and soul'); |
+ | Configure::write('Societe.nom','Pizza'); Configure::write('Societe.slogan','Pizza pour votre corps et votre âme'); |
| </pre> | </pre> | ||
| - | <p class="note">the usage of dot notation in the <code>$key</code> parameter. You can use this notation to organize your configuration into logical groups.</p> <p>The above example could also be written in a single call:</p> |
+ | <p class"note">Remarquez l'utilisation de la notation avec point pour le paramètre <code>$key</code>. Vous pouvez utiliser cette notation pour organiser votre configuration en groupes logiques.</p> <p>L'exemple ci-dessus aurait pu s'écrire aussi en un simple appel :</p> |
| <pre> | <pre> | ||
| Configure::write( | Configure::write( | ||
| - | 'Company',array('name'=>'Pizza, Inc.','slogan'=>'Pizza for your body and soul') | + | 'Societe',array('nom'=>'Pizza','slogan'=>'Pizza pour votre corps et votre âme') |
| ); | ); | ||
| </pre> | </pre> | ||
| - | <p>You can use <code>Configure::write('debug', $int)</code> to switch between debug and production modes on the fly. This is especially handy for AMF or SOAP interactions where debugging information can cause parsing problems.</p> | + | <p>Vous pouvez utiliser <code>Configure::write(‘debug’, $int)</code> pour passer du mode débug au mode production à la volée. Ceci est particulièrement pratique pour les interactions AMF ou SOAP dans lesquelles les informations de débug peuvent poser des problèmes de <em>parsing</em>.</p> |
