<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog.hio.fr &#187; symfony</title>
	<atom:link href="http://blog.hio.fr/tag/symfony/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hio.fr</link>
	<description></description>
	<lastBuildDate>Tue, 07 Sep 2010 04:42:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>PHP Symfony, exemple d&#8217;utilisation de widget et validateur</title>
		<link>http://blog.hio.fr/2010/04/16/php-symfony-exemple-dutilisation-de-widget-et-validateur/</link>
		<comments>http://blog.hio.fr/2010/04/16/php-symfony-exemple-dutilisation-de-widget-et-validateur/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 12:53:59 +0000</pubDate>
		<dc:creator>HiO</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[validator]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://blog.hio.fr/?p=540</guid>
		<description><![CDATA[Voici des exemples d'utilisation des widgets et des validateurs symfony, liste mise a jour au fur et a mesure de mes besoins ^^]]></description>
			<content:encoded><![CDATA[<p>Voici des exemples d&#8217;utilisation des widgets et des validateurs symfony, liste mise a jour au fur et a mesure de mes besoins ^^</p>
<h2>Widgets</h2>
<p><strong>sfWidgetFormDoctrineChoice</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cat_id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormDoctrineChoice<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Category'</span><span style="color: #339933;">,</span>
                                                                      <span style="color: #0000ff;">'model'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'hosts_categories'</span><span style="color: #339933;">,</span>
                                                                      <span style="color: #0000ff;">'add_empty'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>sfWidgetFormInputPassword</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormInputPassword<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Validateurs</h2>
<p><strong>sfValidatorRegex</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'intervalle'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorRegex<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pattern'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/^[0-9]{1}[i,m,d]{1}$/'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>sfValidatorOr</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'intervalle'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorOr<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> sfValidatorRegex<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pattern'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/^[0-9]{1}[i,m,d]{1}$/'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                                                <span style="color: #000000; font-weight: bold;">new</span> sfValidatorRegex<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pattern'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/^[0-9]{1}[i,m,d]{1};[0-9]{2}h[0-9]{2}$/'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>sfValidatorAnd</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setPostValidator</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> sfValidatorAnd<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> sfValidatorSchemaCompare<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'repassword'</span><span style="color: #339933;">,</span>  sfValidatorSchemaCompare<span style="color: #339933;">::</span><span style="color: #004000;">EQUAL</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                                                  <span style="color: #000000; font-weight: bold;">new</span> sfValidatorDoctrineUnique<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'model'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'sfGuardUser'</span><span style="color: #339933;">,</span>
                                                                                                      <span style="color: #0000ff;">'column'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'invalid'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'This username already taken.'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                                                  <span style="color: #000000; font-weight: bold;">new</span> sfValidatorDoctrineUnique<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'model'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'sfGuardUser'</span><span style="color: #339933;">,</span>
                                                                                                      <span style="color: #0000ff;">'column'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'email_address'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'invalid'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'This email address already taken.'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                                                                  <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>sfValidatorSchemaCompare</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorString<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'min_length'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'max_length'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'repassword'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorString<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'required'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setPostValidator</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> sfValidatorSchemaCompare<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'repassword'</span><span style="color: #339933;">,</span>  sfValidatorSchemaCompare<span style="color: #339933;">::</span><span style="color: #004000;">EQUAL</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.hio.fr/2010/04/16/php-symfony-exemple-dutilisation-de-widget-et-validateur/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Symfony, Comment passer une valeur a un objet sfForm dans le backend d&#8217;une application</title>
		<link>http://blog.hio.fr/2010/04/12/php-symfony-comment-passer-une-valeur-a-un-objet-sfform-dans-le-backend-dune-application/</link>
		<comments>http://blog.hio.fr/2010/04/12/php-symfony-comment-passer-une-valeur-a-un-objet-sfform-dans-le-backend-dune-application/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 13:00:36 +0000</pubDate>
		<dc:creator>HiO</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.hio.fr/?p=535</guid>
		<description><![CDATA[<strong>apps/backend/modules/hosts/actions/actions.class.php</strong>
<pre lang="php" line="1">
class hostsActions extends autoHostsActions
{

  public function executeCreate(sfWebRequest $request)
  {
    $this->form = $this->configuration->getForm();
    $this->hosts = $this->form->getObject();
                                                                                                                                            
    $tainted_values = $request->getParameter($this->form->getName());     
    $tainted_values['user_id'] = $this->getUser()->getGuardUser()->getId();

    $request->setParameter($this->form->getName(), $tainted_values);
    parent::processForm($request, $this->form);
    $this->setTemplate('new');
  }
}
</pre>]]></description>
			<content:encoded><![CDATA[<p><strong>apps/backend/modules/hosts/actions/actions.class.php</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> hostsActions <span style="color: #000000; font-weight: bold;">extends</span> autoHostsActions
<span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> executeCreate<span style="color: #009900;">&#40;</span>sfWebRequest <span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">configuration</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getForm</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hosts</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$tainted_values</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$request</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     
    <span style="color: #000088;">$tainted_values</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user_id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUser</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getGuardUser</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$request</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setParameter</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tainted_values</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    parent<span style="color: #339933;">::</span><span style="color: #004000;">processForm</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setTemplate</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'new'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.hio.fr/2010/04/12/php-symfony-comment-passer-une-valeur-a-un-objet-sfform-dans-le-backend-dune-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Symfony, Comment récupérer la route courante dans les templates</title>
		<link>http://blog.hio.fr/2010/03/26/comment-recuperer-la-route-courante-dans-les-templates/</link>
		<comments>http://blog.hio.fr/2010/03/26/comment-recuperer-la-route-courante-dans-les-templates/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 14:32:42 +0000</pubDate>
		<dc:creator>HiO</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.hio.fr/?p=531</guid>
		<description><![CDATA[<strong>indexSuccess.php</strong>
<pre lang="php">
sfContext::getInstance()->getRouting()->getCurrentRouteName()
</pre>

Renvoi
"homepage"
Si votre route s'appelle "homepage" bien sur ^^
<pre lang="yaml">
homepage:
  url: /
  param: { module: product, action: index }
</pre>]]></description>
			<content:encoded><![CDATA[<p><strong>indexSuccess.php</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">sfContext<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRouting</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCurrentRouteName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Renvoi<br />
&laquo;&nbsp;homepage&nbsp;&raquo;<br />
Si votre route s&#8217;appelle &laquo;&nbsp;homepage&nbsp;&raquo; bien sur ^^</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">homepage:
  url: /
  param: { module: product, action: index }</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.hio.fr/2010/03/26/comment-recuperer-la-route-courante-dans-les-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Symfony, Comment changer les messages par defaut des validateurs Symfony</title>
		<link>http://blog.hio.fr/2010/01/14/comment-changer-les-messages-par-defaut-des-validateurs-symfony/</link>
		<comments>http://blog.hio.fr/2010/01/14/comment-changer-les-messages-par-defaut-des-validateurs-symfony/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 14:23:51 +0000</pubDate>
		<dc:creator>HiO</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.hio.fr/?p=389</guid>
		<description><![CDATA[Comment faire , quand on veut changer tous les messages par défaut des validateurs Symfony , sans les définir un par un par un bete 'message' => 'mais blublu' et sans allez les changer directement dans les entrailles de symfony ce qui est mal !!! C'est mal !!!]]></description>
			<content:encoded><![CDATA[<p>Comment faire , quand on veut changer tous les messages par défaut des validateurs Symfony , sans les définir un par un par un bete &#8216;message&#8217; => &#8216;mais blublu&#8217; et sans allez les changer directement dans les entrailles de symfony ce qui est mal !!! C&#8217;est mal !!!</p>
<p>oh oui dit nous père castor<br />
Et bien comme ça</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    sfValidatorBase<span style="color: #339933;">::</span><span style="color: #004000;">setInvalidMessage</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Champ invalide'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    sfValidatorBase<span style="color: #339933;">::</span><span style="color: #004000;">setRequiredMessage</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Champ obligatoire'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    parent<span style="color: #339933;">::</span><span style="color: #004000;">setup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Ce qui nous donne dans un vrai bout de php</p>
<p><strong>VentesForm.class.php</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> VentesForm <span style="color: #000000; font-weight: bold;">extends</span> BaseVentesForm
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> configure<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    sfValidatorBase<span style="color: #339933;">::</span><span style="color: #004000;">setInvalidMessage</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Champ invalide'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    sfValidatorBase<span style="color: #339933;">::</span><span style="color: #004000;">setRequiredMessage</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Champ obligatoire'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    parent<span style="color: #339933;">::</span><span style="color: #004000;">setup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'created_at'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'updated_at'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
          <span style="color: #000088;">$this</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'expires_at'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'is_active'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'uid'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormInput<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'hidden'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'is_hidden'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'civ'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormChoice<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'choices'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'M.'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'M.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mme'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Mme'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mlle'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Mlle'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'adresse1'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormTextarea<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'adresse2'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormTextarea<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'adresse3'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormTextarea<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorEmail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'invalid'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'L\'adresse email saisie est incorrecte'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLabel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'numeroabo'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N°Abonné'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://www.symfony-project.org/api/1_2/sfValidatorBase">sfValidatorBase</a></p>
<p><strong>NOTE:</strong><br />
Deprecated depuis la version 1.4 de symfony remplacer par<br />
sfValidatorBase::setDefaultMessage() method</p>
<p><a href="http://www.symfony-project.org/tutorial/1_4/en/deprecated">http://www.symfony-project.org/tutorial/1_4/en/deprecated</a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">sfValidatorBase<span style="color: #339933;">::</span><span style="color: #004000;">setDefaultMessage</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'invalid'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Champ invalide'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
sfValidatorBase<span style="color: #339933;">::</span><span style="color: #004000;">setDefaultMessage</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'required'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Champ obligatoire'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
parent<span style="color: #339933;">::</span><span style="color: #004000;">setup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.hio.fr/2010/01/14/comment-changer-les-messages-par-defaut-des-validateurs-symfony/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Symfony Text Helper</title>
		<link>http://blog.hio.fr/2010/01/08/php-symfony-text-helper/</link>
		<comments>http://blog.hio.fr/2010/01/08/php-symfony-text-helper/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 08:14:01 +0000</pubDate>
		<dc:creator>HiO</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[helper]]></category>

		<guid isPermaLink="false">http://blog.hio.fr/?p=490</guid>
		<description><![CDATA[Text Helper]]></description>
			<content:encoded><![CDATA[<p><strong>Text Helper</strong><br />
<a href="http://www.symfony-project.org/api/1_4/TextHelper">http://www.symfony-project.org/api/1_4/TextHelper</a></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> use_helper<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Text'</span><span style="color: #009900;">&#41;</span>
<span style="color: #b1b100;">echo</span> auto_link_text<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Turns all urls and email addresses into clickable links. The +link+ parameter can limit what should be linked.</span>
<span style="color: #b1b100;">echo</span> excerpt_text<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Extracts an excerpt from the +text+ surrounding the +phrase+ with a number of characters on each side determined</span>
<span style="color: #b1b100;">echo</span> highlight_text<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$phrase</span><span style="color: #339933;">,</span> <span style="color: #000088;">$highlighter</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Highlights the +phrase+ where it is found in the +text+ by surrounding it like</span>
<span style="color: #b1b100;">echo</span> simple_format_text<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>  <span style="color: #666666; font-style: italic;">// Returns +text+ transformed into html using very simple formatting rules</span>
<span style="color: #b1b100;">echo</span> strip_links_text<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Turns all links into words, like &quot;&lt;a href=&quot;something&quot;&gt;else&lt;/a&gt;&quot; to &quot;else&quot;.</span>
<span style="color: #b1b100;">echo</span> truncate_text<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Truncates +text+ to the length of +length+ and replaces the last three characters with the +truncate_string+</span>
<span style="color: #b1b100;">echo</span> wrap_text<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Word wrap long lines to line_width.</span>
<span style="color: #b1b100;">echo</span> _auto_link_email_addresses<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Turns all email addresses into clickable links.</span>
<span style="color: #b1b100;">echo</span> _auto_link_urls<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// Turns all urls into clickable links</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.hio.fr/2010/01/08/php-symfony-text-helper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Symfony Date Helper</title>
		<link>http://blog.hio.fr/2009/12/24/php-symfony-divers/</link>
		<comments>http://blog.hio.fr/2009/12/24/php-symfony-divers/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 15:52:45 +0000</pubDate>
		<dc:creator>HiO</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[helper]]></category>

		<guid isPermaLink="false">http://blog.hio.fr/?p=484</guid>
		<description><![CDATA[Date helper]]></description>
			<content:encoded><![CDATA[<p><strong>Date helper</strong><br />
<a href="http://www.symfony-project.org/api/1_4/DateHelper">http://www.symfony-project.org/api/1_4/DateHelper</a></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
use_helper<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Date'</span><span style="color: #009900;">&#41;</span> 
<span style="color: #b1b100;">echo</span> format_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span> 
<span style="color: #b1b100;">echo</span> format_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'d'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'en'</span><span style="color: #009900;">&#41;</span> 
<span style="color: #b1b100;">echo</span> format_datetime<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span>
<span style="color: #b1b100;">echo</span> format_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'MM/yyyy'</span><span style="color: #009900;">&#41;</span> 
<span style="color: #b1b100;">echo</span> format_daterange<span style="color: #009900;">&#40;</span><span style="color: #000088;">$start_date</span><span style="color: #339933;">,</span> <span style="color: #000088;">$end_date</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'MM/yy'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'from %s to %s'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'starting from %s'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'until %s'</span><span style="color: #009900;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.hio.fr/2009/12/24/php-symfony-divers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Symfony, fichier d&#8217;exemple routing.yml</title>
		<link>http://blog.hio.fr/2009/09/04/php-symfony-fichier-dexemple-routing-yml/</link>
		<comments>http://blog.hio.fr/2009/09/04/php-symfony-fichier-dexemple-routing-yml/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 06:07:38 +0000</pubDate>
		<dc:creator>HiO</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[routing.yml]]></category>

		<guid isPermaLink="false">http://blog.hio.fr/?p=447</guid>
		<description><![CDATA[<strong>routing.yml</strong>
ou ? apps/%app%/config/routing.yml]]></description>
			<content:encoded><![CDATA[<p><strong>routing.yml</strong><br />
ou ? apps/%app%/config/routing.yml</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;"># default rules
homepage:
  url:   /
  param: { module: post, action: index }
&nbsp;
post_show:
  url:   /blog/:slug.:sf_format
  class: sfDoctrineRoute
  param: { module: post, action: show, sf_format: html }
  options:
    generate_shortest_url: false
    type: object
    model: BlogPost
    column: slug
  requirements:
    sf_method: get
&nbsp;
post_addComment:
  url: /comment/add
  class: sfRequestRoute
  param: { module: post, action: addComment }
  requirements:
    sf_method: post</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.hio.fr/2009/09/04/php-symfony-fichier-dexemple-routing-yml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony expliqué à ma maman, 1ère partie : qu’est-ce qu’un framework ?</title>
		<link>http://blog.hio.fr/2009/08/26/symfony-explique-a-ma-maman-1ere-partie-qu%e2%80%99est-ce-qu%e2%80%99un-framework/</link>
		<comments>http://blog.hio.fr/2009/08/26/symfony-explique-a-ma-maman-1ere-partie-qu%e2%80%99est-ce-qu%e2%80%99un-framework/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 07:12:03 +0000</pubDate>
		<dc:creator>HiO</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[framework]]></category>

		<guid isPermaLink="false">http://blog.hio.fr/?p=426</guid>
		<description><![CDATA[Haha assez rigolo et surtout tres vrai, maintenant vous saurez quoi repondre qd on vous demandera ce qu'est un framework et vous aussi vous pourrez briller en societe et avoir une rolex a 50 ans en lieu et place de votre montre flick flack actuelle ^^]]></description>
			<content:encoded><![CDATA[<p>Haha assez rigolo et surtout tres vrai, maintenant vous saurez quoi repondre qd on vous demandera ce qu&#8217;est un framework et vous aussi vous pourrez briller en societe et avoir une rolex a 50 ans en lieu et place de votre montre flick flack actuelle ^^</p>
<blockquote><p>A mes heures pas perdues je travaille dans l’agence qui est à l’origine d’une fort belle chose : un framework PHP 5 qui jouit d’une assez bonne presse, ce qui n’est pas complètement un hasard parce qu’il est vraiment très bien [1].</p>
<p>Ce framework porte le nom de Symfony, pour des raisons expliquées ici. Jusque là, fastoche. C’est ensuite que ça se complique. Déjà, rien que le premier mot : framework. Littéralement, cadre ou structure ; dans la programmation en général, on le traduit plus précisément par « cadre d’applications ». Enfin, on le traduirait, parce qu’on ne le fait jamais, on dit toujours frèmeouorque. A compter de cette phrase, je dirai d’ailleurs « framework » sans autre forme de procès, et même sans italiques (je suis comme ça, jsuis un gueudin).</p>
<p>Pour commencer, donc, qu’est-ce qu’un framework ? S’il y avait une réponse simple, on se passerait de ces lignes. La difficulté majeure tient à ce qu’il y a en fait dans la définition deux dimensions principales, complémentaires mais en partie indépendantes : un framework c’est à la fois une boîte à outils et une méthodologie. Ou, si on n’a pas peur des envolées lyriques : une boîte à outils fournie avec une philosophie.</p></blockquote>
<p>Et tout l&#8217;article ici, <a href="http://www.do-as-i-say.com/notes/2009/08/symfony-explique-a-ma-maman-1/" target="_blank">CLICK MOI CLICK MOI CLICK MOI</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hio.fr/2009/08/26/symfony-explique-a-ma-maman-1ere-partie-qu%e2%80%99est-ce-qu%e2%80%99un-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
