<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://mirmodynamics.com/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Mirmo Dynamics - Tag - symfony</title>
  <link>http://mirmodynamics.com/</link>
  <atom:link href="http://mirmodynamics.com/feed/tag/symfony/rss2" rel="self" type="application/rss+xml"/>
  <description>Rien de grand ne se fit jamais sans enthousiasme.</description>
  <language>en</language>
  <pubDate>Tue, 18 Nov 2008 12:26:30 +0100</pubDate>
  <copyright>2003-2008 &amp;copy; Geoffrey Bachelet</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Passing arbitrary parameters to a route in symfony</title>
    <link>http://mirmodynamics.com/post/2008/11/02/Passing-arbitrary-parameters-to-a-route-in-symfony</link>
    <guid isPermaLink="false">urn:md5:7954eb5f9f623e4d1fcd8829f2d32adb</guid>
    <pubDate>Sun, 02 Nov 2008 21:12:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>handy</category><category>parameters</category><category>routing</category><category>symfony</category><category>tips</category>    
    <description>    &lt;p&gt;Parameters are an important parts of routes in symfony, and in any other routing framework for that matter, and everyone knows how to add mandatory or optional parameters to a route. But did you know you can also silently pass arbitrary parameters to a route from the routing definitions ? This may not be a very clear description, so let's take an example. Say you have a tabbed navigation system, and you want to know in your template which tab is the current one. In a perfect world, you could assume one tab corresponds to a module and check this module, but let's say that one tab can contain multiples modules. How are you doing now ? Quite simply actually, by passing a &lt;code&gt;tab&lt;/code&gt; parameter to your route.&lt;/p&gt;

&lt;pre&gt;
foo_route:
  url:       /foo
  param: { tab: foobar }

bar_route:
  url:       /bar
  param: { tab: foobar }
&lt;/pre&gt;


&lt;p&gt;Now you can access the tab parameter in your layout:&lt;/p&gt;

&lt;pre&gt;
&amp;lt;?php $currentTab = $sf_params-&amp;gt;get('tab'); ?&amp;gt;
&lt;/pre&gt;


&lt;p&gt;Easy heh ? Of course this kind of parameters is not limited to tell which tab we're currently in, you can, for example, bypass the limitation of a system that requires a particular file to be in a particular location (not that using mod_rewrite would not be more efficient, I just wanted one more example):&lt;/p&gt;

&lt;pre&gt;
foobar_xml:
  url:       /a/stupid/url/that/you/cant/change/foobar.xml
  param: { module: default, action: static, file: &amp;quot;/assets/foobar.xml&amp;quot;, mimetype: &amp;quot;text/xml&amp;quot; }
&lt;/pre&gt;


&lt;p&gt;Here we simply pass the &lt;code&gt;file&lt;/code&gt; and &lt;code&gt;mimetype&lt;/code&gt; parameters to an action that'll take care to serve the right file.&lt;/p&gt;


&lt;p&gt;Handy ! But please note that you can't pass such parameters in &lt;code&gt;sfPropelRouteCollection&lt;/code&gt; for now (yup, this a bug, and there's a ticket already).&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2008/11/02/Passing-arbitrary-parameters-to-a-route-in-symfony#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2008/11/02/Passing-arbitrary-parameters-to-a-route-in-symfony#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1150</wfw:commentRss>
      </item>
    
  <item>
    <title>Now working at Sensio Labs</title>
    <link>http://mirmodynamics.com/post/2008/10/15/Now-working-at-Sensio-Labs</link>
    <guid isPermaLink="false">urn:md5:c3888f52659b587aef0de437e1a6b71b</guid>
    <pubDate>Wed, 15 Oct 2008 20:11:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Ego</category>
        <category>sensio</category><category>symfony</category><category>work</category><category>zend framework</category>    
    <description>    &lt;p&gt;A quick post to tell (for those not knowing already) that I now work at &lt;a href=&quot;http://sensiolabs.com/&quot;&gt;Sensio Labs&lt;/a&gt;, creators of &lt;a href=&quot;http://www.symfony-project.org/&quot;&gt;the symfony framework&lt;/a&gt;. Expect some symfony stuff to be posted regularly \o/&lt;/p&gt;


&lt;p&gt;For those wondering, yes that means I'm actually dropping any previously started ZF related development for good, I'll post something soon on why I don't like ZF anymore :-)&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2008/10/15/Now-working-at-Sensio-Labs#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2008/10/15/Now-working-at-Sensio-Labs#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1143</wfw:commentRss>
      </item>
    
  <item>
    <title>A specific stylesheet for each module</title>
    <link>http://mirmodynamics.com/post/2008/10/15/A-specific-stylesheet-for-each-module</link>
    <guid isPermaLink="false">urn:md5:3d62ec1a3d453aff01166ab7a3582263</guid>
    <pubDate>Wed, 15 Oct 2008 00:43:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>configuration</category><category>css</category><category>stylesheets</category><category>symfony</category><category>tips</category><category>yaml</category>    
    <description>    &lt;p&gt;So this is the first post of the newly opened &lt;a href=&quot;http://mirmodynamics.com/category/symfony&quot;&gt;symfony category&lt;/a&gt; of this blog, and I want to make things clear right now: you (most likely) won't find (yet) any &lt;strong&gt;pro&lt;/strong&gt;tip or high level symfony tutorials here, as I'm still in the process of learning symfony. The good news though is that I'm currently assigned an 1.2-DEV project, so you may get some insight at what's up in the dev branch of the framework (especially regarding sfForm) :-)&lt;/p&gt;


&lt;p&gt;If your are looking for more complete material on the subject, please redirect yourself to &lt;a href=&quot;http://www.symfony-project.org/&quot;&gt;the official website&lt;/a&gt; (where you can find the documentation and a very interesting blog) or &lt;a href=&quot;http://www.aide-de-camp.org/&quot;&gt;Fabien's blog&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;That said, I think it could be interesting to post all the little things I learn everyday that make development with symfony easier for the everyday php developper that you might be if you made it this far into this post ;-)&lt;/p&gt;


&lt;p&gt;Soooo, let's begin the show, with some yaml magic. Yaml I said ? Yaml I said. For those not knowing yet, yaml is the format of choice for symfony's configurations file. So what's the point between configuration files and stylesheets ? Let's say you've got a symfony application (say, frontend), and you'd like a particular module (say, news) in this application to have its own stylesheet in addition of the defaults stylesheets you defined already. Very simple, you start by creating the adequate configuration file:&lt;/p&gt;

&lt;pre&gt;
cd apps/frontend/modules/news/
mkdir config
vi config/view.yml
&lt;/pre&gt;


&lt;p&gt;All you have to do know is declare the stylesheet:&lt;/p&gt;

&lt;pre&gt;
all:
  stylesheets: [news]
&lt;/pre&gt;


&lt;p&gt;And that's all, no helper call in the layout, your &lt;code&gt;news.css&lt;/code&gt; will automagically be appended to the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; of your generated html. You can also declare multiples css, or control which actions get a particular css, and even specify to which media they apply:&lt;/p&gt;

&lt;pre&gt;
all:
  stylesheets: [news, news_print: { media: print }]
list:
  stylesheets: [list]
&lt;/pre&gt;


&lt;p&gt;Handy, heh.&lt;/p&gt;


&lt;p&gt;But that's not all ! If you're not that much into yaml, you can use a view helper, directly into your template:&lt;/p&gt;

&lt;pre&gt;
&amp;lt;?php use_stylesheet('news'); ?&amp;gt;
&lt;/pre&gt;


&lt;p&gt;Or even add it from the controller:&lt;/p&gt;

&lt;pre&gt;
&amp;lt;?php $this-&amp;gt;getResponse()-&amp;gt;addStylesheet('news'); ?&amp;gt;
&lt;/pre&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2008/10/15/A-specific-stylesheet-for-each-module#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2008/10/15/A-specific-stylesheet-for-each-module#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1142</wfw:commentRss>
      </item>
    
  <item>
    <title>Il est bon ton café gringo</title>
    <link>http://mirmodynamics.com/post/2008/10/14/Il-est-bon-ton-cafe-gringo</link>
    <guid isPermaLink="false">urn:md5:aec3c2300871dc058907cba8a4f135a6</guid>
    <pubDate>Tue, 14 Oct 2008 00:42:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Ego</category>
        <category>noob</category><category>sensio</category><category>symfony</category><category>travail</category>    
    <description>    &lt;p&gt;Un petit post rapide pour dire (pour ceux qui ne savaient pas déjà) que je bosse désormais chez &lt;a href=&quot;http://sensiolabs.com/&quot;&gt;Sensio Labs&lt;/a&gt;, les créateurs de &lt;a href=&quot;http://www.symfony-project.org/&quot;&gt;symfony&lt;/a&gt;, depuis une bonne grosse semaine maintenant. J'aurai donc bientot plein de tips de noob à vous raconter sur symfony \o/&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2008/10/14/Il-est-bon-ton-cafe-gringo#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2008/10/14/Il-est-bon-ton-cafe-gringo#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1140</wfw:commentRss>
      </item>
    
  <item>
    <title>Symfonians, un site pour les maestros en herbe</title>
    <link>http://mirmodynamics.com/post/2008/01/21/Symfonians-un-site-pour-les-maestros-en-herbe</link>
    <guid isPermaLink="false">urn:md5:0affcf89b7f27a2ea360dbc68f206e4d</guid>
    <pubDate>Mon, 21 Jan 2008 11:06:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Geekeries</category>
        <category>communauté</category><category>prendreuncafe</category><category>pub</category><category>symfonians</category><category>symfony</category>    
    <description>    &lt;p&gt;Les utilisateurs du framework &lt;a href=&quot;http://www.symfony-project.org/&quot;&gt;symfony&lt;/a&gt; ont désormais leur cafet' dédiée pour aller prendre un ptit café ! Pour résumer, &lt;a href=&quot;http://www.symfonians.net/&quot;&gt;symfonians&lt;/a&gt; se propose de réunir la petite communauté symfony autour de fonctionnalités aussi conviviales qu'utiles, telles que la création d'un profile développeur symfony, des offres d'emploi, ce genre de choses quoi. Le projet est chapoté par &lt;a href=&quot;http://www.prendreuncafe.com/&quot;&gt;NiKo&lt;/a&gt;, ce qui au moins est un gage de bonne qualité.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2008/01/21/Symfonians-un-site-pour-les-maestros-en-herbe#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2008/01/21/Symfonians-un-site-pour-les-maestros-en-herbe#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1082</wfw:commentRss>
      </item>
    
</channel>
</rss>