<?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>Si tu kiffes pas reunoi, t'écoutes pas et puis c'est tout.</description>
  <language>en</language>
  <pubDate>Sun, 14 Mar 2010 19:59:01 +0100</pubDate>
  <copyright>2003-2009 &amp;copy; Geoffrey Bachelet</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Symfony Live 2010, now what ?</title>
    <link>http://mirmodynamics.com/post/2010/02/18/Symfony-Live-2010%2C-now-what</link>
    <guid isPermaLink="false">urn:md5:7f220320c24e5b582d5acda5abf148ff</guid>
    <pubDate>Thu, 18 Feb 2010 13:08:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>sflive2010</category><category>symfony</category>    
    <description>    &lt;p&gt;Yesterday was the second and last day of the Symfony Live's conferences (I'm not counting the trainings).&lt;/p&gt;


&lt;p&gt;So what was it all about ? Great talks were given, announcements were made (Nils Aderman, phpbb's lead developer suggested phpbb4 would run on top of Symfony 2), and most important (as as I'm concerned), great people were met. It's been a real pleasure to put a face on names like &lt;a href=&quot;http://twitter.com/denderello&quot;&gt;@denderello&lt;/a&gt;, &lt;a href=&quot;http://twitter.com/skoop&quot;&gt;@skoop&lt;/a&gt;, &lt;a href=&quot;http://twitter.com/webmozart&quot;&gt;@webmozart&lt;/a&gt;, and frenchier people like &lt;a href=&quot;http://twitter.com/vjousse&quot;&gt;@vjousse&lt;/a&gt;, &lt;a href=&quot;http://twitter.com/timbarray&quot;&gt;@timbarray&lt;/a&gt; or &lt;a href=&quot;http://twitter.com/nsilberman&quot;&gt;@nsilberman&lt;/a&gt;. It's also been very interesting to meet people that I didn't previously know, of course!&lt;/p&gt;


&lt;p&gt;From a personnal point of view, I've learnt a lot this year. This was my very first english-spoken presentation (I've already given a talk last year but it was in french), and I was a bit nervous to say the least. So basically, I kind of screwed my talk. I also learnt that a talk requires a lot of preparation, much more than I had put in this one actually, that's another reason why this talk was not as good as expected by several attendees. Anyway, I'm now aware of these flaws, and I'm going to work hard for my next talk :-)&lt;/p&gt;


&lt;p&gt;The culminating point of the event was, of course, the revelation of Symfony 2's preview release. Symfony 2 is going to be awesome, really, and if you don't believe me, just go check the &lt;a href=&quot;http://symfony-reloaded.org/&quot;&gt;official website&lt;/a&gt; or &lt;a href=&quot;http://www.slideshare.net/fabpot/symfony-20-revealed&quot;&gt;Fabien's presentation&lt;/a&gt;. And if you're still not convinced, well, too bad for you :-) (you can also try it, &lt;a href=&quot;http://github.com/symfony/symfony&quot;&gt;it's all available on github&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;What is really awesome about Symfony 2 is how it borrows concepts from other frameworks and kindly adapts them to PHP. The bundle system for example, while not exactly a new concept per-se (I guess Fabien got a lot of inspiration from django on this one) will totally change the way we, Symfony 2 users, will write web applications, and I'm really looking forward to see what great use people will make of the framework (more on that in another blog post).&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2010/02/18/Symfony-Live-2010%2C-now-what#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2010/02/18/Symfony-Live-2010%2C-now-what#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1209</wfw:commentRss>
      </item>
    
  <item>
    <title>The symfony 2009 advent calendar: &quot;More with symfony&quot;</title>
    <link>http://mirmodynamics.com/post/2009/12/01/The-symfony-2009-advent-calendar%3A-More-with-symfony</link>
    <guid isPermaLink="false">urn:md5:3c65f446fbe2dc68e4ff2260f1dbda8a</guid>
    <pubDate>Tue, 01 Dec 2009 17:21:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>advent2009</category><category>symfony</category>    
    <description>    &lt;p&gt;I am very pleased to relay that news: the symfony 2009 advent calendar is now available on the symfony project website:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;read fabien's &lt;a href=&quot;http://www.symfony-project.org/blog/2009/12/01/one-more-thing&quot;&gt;announcement&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;read &lt;a href=&quot;http://www.symfony-project.org/advent_calendar/1/en&quot;&gt;the first chapter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It has been a tough work from all the people involved in this project (including me ;), and I'm really happy to see that it's finaly on the tracks :-)&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/12/01/The-symfony-2009-advent-calendar%3A-More-with-symfony#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/12/01/The-symfony-2009-advent-calendar%3A-More-with-symfony#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1205</wfw:commentRss>
      </item>
    
  <item>
    <title>Symfony Pot, le mercredi 21 octobre à Paris</title>
    <link>http://mirmodynamics.com/post/2009/10/15/Symfony-Pot%2C-le-mercredi-21-octobre-%C3%A0-Paris</link>
    <guid isPermaLink="false">urn:md5:bfd476acd11495a7f144643d347af3a3</guid>
    <pubDate>Thu, 15 Oct 2009 10:16:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>afsy</category><category>biere</category><category>geek</category><category>hallsbeer</category><category>sfpot</category><category>symfony</category>    
    <description>    &lt;p&gt;Discuter de symfony entre geeks autour d'une (ou plusieurs) bière(s), ça vous tente ? Alors rendez-vous le mercredi 21 octobre au &lt;a href=&quot;http://www.hallsbeer.com/&quot;&gt;Hall's Beer&lt;/a&gt;, un bar a bière fort sympathique à la carte des bières fort conséquente, situé d'une manière fort convenante à Chatelet les Halles, 68 rue Saint Denis très exactement (&lt;a href=&quot;http://maps.google.fr/maps?f=q&amp;amp;source=s_q&amp;amp;hl=fr&amp;amp;geocode=&amp;amp;q=hall's+beer&amp;amp;sll=46.75984,1.738281&amp;amp;sspn=8.672102,19.709473&amp;amp;ie=UTF8&amp;amp;hq=hall's+beer&amp;amp;hnear=&amp;amp;ll=48.861892,2.348746&amp;amp;spn=0.004066,0.009624&amp;amp;t=h&amp;amp;z=17&amp;amp;iwloc=A&quot;&gt;lien google map pour les fainéants&lt;/a&gt;). On peut aussi y manger pour ceux qui ont faim.&lt;/p&gt;


&lt;p&gt;Début des hostilités à 19h. Venez nombreux !&lt;/p&gt;


&lt;p&gt;PS: ceux qui viennent auront l'occasion de discuter d'un projet francophone de grande envergure autour de symfony (il y a un indice caché dans ce post).&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/10/15/Symfony-Pot%2C-le-mercredi-21-octobre-%C3%A0-Paris#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/10/15/Symfony-Pot%2C-le-mercredi-21-octobre-%C3%A0-Paris#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1202</wfw:commentRss>
      </item>
    
  <item>
    <title>Dynamic directory with sfValidatorFile</title>
    <link>http://mirmodynamics.com/post/2009/10/14/Dynamic-directory-with-sfValidatorFile</link>
    <guid isPermaLink="false">urn:md5:0b3f55753dc88911b8afa1fcdfdf4882</guid>
    <pubDate>Wed, 14 Oct 2009 23:22:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>directory</category><category>form</category><category>sfForm</category><category>sfValidatorFile</category><category>symfony</category><category>tips</category><category>upload</category>    
    <description>    &lt;p&gt;Say you have a form with a file upload (field &lt;code&gt;image&lt;/code&gt; of your model for example), and that you want to save your file in a directory depending on its filename. For example, the file &lt;code&gt;foobar.jpg&lt;/code&gt; shall be stored in &lt;code&gt;fo/ob/foobar.jpg&lt;/code&gt;. All you have to do is implement a &lt;code&gt;generateImageFilename&lt;/code&gt; method in your model:&lt;/p&gt;

&lt;pre&gt;
  public function generateImageFilename(sfValidatedFile $file)
  {
    $filename = $file-&amp;gt;generateFilename();
    return sprintf('%s/%s/%s', substr($filename, 0, 2), substr($filename, 1, 2), $filename);
  }
&lt;/pre&gt;


&lt;p&gt;And voila !&lt;/p&gt;


&lt;p&gt;For more information on what's happening there, see &lt;code&gt;sfFormDoctrine::saveFile()&lt;/code&gt; (around line 510 of &lt;code&gt;plugins/sfDoctrinePlugin/lib/form//sfFormDoctrine.class.php&lt;/code&gt;)&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/10/14/Dynamic-directory-with-sfValidatorFile#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/10/14/Dynamic-directory-with-sfValidatorFile#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1201</wfw:commentRss>
      </item>
    
  <item>
    <title>Help Symfony: fix one bug per day and win some gifts !</title>
    <link>http://mirmodynamics.com/post/2009/07/01/Help-Symfony%3A-fix-one-bug-per-day-and-win-some-gifts-%21</link>
    <guid isPermaLink="false">urn:md5:601fa602193a596a65fe14b912586ba1</guid>
    <pubDate>Wed, 01 Jul 2009 19:31:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Geekeries</category>
        <category>1day1ticket</category><category>symfony</category>    
    <description>    &lt;p&gt;Today is the first day of the &amp;quot;1 day / 1 ticket&amp;quot; Symfony event.&lt;/p&gt;


&lt;p&gt;Starting from today, each ticket you close (or help closing) from &lt;a href=&quot;http://trac.symfony-project.org/wiki/1day1ticket&quot;&gt;this list&lt;/a&gt; by either submitting a patch, submitting unit tests, etc will earn you points. At the end of the month, gifts are attributed to people with the most points.&lt;/p&gt;


&lt;p&gt;This is a fun and exciting way to help your (hopefuly) favorite opensource project ;)&lt;/p&gt;


&lt;p&gt;For more details on rules, please &lt;a href=&quot;http://trac.symfony-project.org/wiki/1day1ticket&quot;&gt;see the official page&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/07/01/Help-Symfony%3A-fix-one-bug-per-day-and-win-some-gifts-%21#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/07/01/Help-Symfony%3A-fix-one-bug-per-day-and-win-some-gifts-%21#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1197</wfw:commentRss>
      </item>
    
  <item>
    <title>Speaking at Symfony Live 09</title>
    <link>http://mirmodynamics.com/post/2009/05/06/Speaking-at-Symfony-Live-09</link>
    <guid isPermaLink="false">urn:md5:04df1543573abbe471f86517b110d1a7</guid>
    <pubDate>Wed, 06 May 2009 09:22:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Ego</category>
        <category>continuous integration</category><category>sflive09fr</category><category>symfony</category><category>talk</category><category>unit testing</category>    
    <description>    &lt;p&gt;For those not following &lt;a href=&quot;http://twitter.com/ubermuda&quot;&gt;me on twitter&lt;/a&gt; (shame on you), &lt;a href=&quot;http://www.symfony-live.com/schedule#session-hh1&quot;&gt;I will be speaking about unit and functional testing in Symfony&lt;/a&gt; (with a tiny bit of continuous integration too) at &lt;a href=&quot;http://www.symfony-live.com/&quot;&gt;Symfony Live 2009&lt;/a&gt;. I will not be alone since my workmate &lt;a href=&quot;http://www.hugohamon.com/&quot;&gt;Hugo Hamon&lt;/a&gt; will be under the spotlights with me. Also, the talk will be given in french.&lt;/p&gt;


&lt;p&gt;Hope to see you there :)&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/05/06/Speaking-at-Symfony-Live-09#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/05/06/Speaking-at-Symfony-Live-09#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1193</wfw:commentRss>
      </item>
    
  <item>
    <title>Customizing actions in symfony's admin generator</title>
    <link>http://mirmodynamics.com/post/2009/03/30/Customizing-actions-in-symfony-s-admin-generator</link>
    <guid isPermaLink="false">urn:md5:7e4c96ac2f177d1f6eb9779bab92e71f</guid>
    <pubDate>Mon, 30 Mar 2009 23:31:00 +0200</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>admingen</category><category>customize</category><category>helper</category><category>quickie</category><category>symfony</category>    
    <description>    &lt;p&gt;A quick tip about symfony's admin generator: if you want to have a custom action, with the following &lt;code&gt;generator.yml&lt;/code&gt; bit for example (actions prefixed with an underscore are builtin admin-gen actions):&lt;/p&gt;

&lt;pre&gt;
form:
  actions:
    _delete:  ~
    _cancel:  ~
    _save:    ~
    _save_and_add: ~
    custom: ~
&lt;/pre&gt;


&lt;p&gt;You can totally customize the link generated for this action (to add javascript for example) using the generator helper in your module's &lt;code&gt;lib/&lt;/code&gt; directory:&lt;/p&gt;

&lt;pre&gt;
[php]
public function linkToCustom($object, $params)
{
  return '&amp;lt;a href=&amp;quot;#&amp;quot; onclick=&amp;quot;console.log(\'woohoo\'); return false;&amp;quot;&amp;gt;log woohoo&amp;lt;/a&amp;gt;';
}
&lt;/pre&gt;


&lt;p&gt;You get passed the current object as an argument, and whatever parameters you passed in the &lt;code&gt;generator.yml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
    custom: { label: 'WOOHOO' }
&lt;/pre&gt;


&lt;pre&gt;
[php]
public function linkToCustom($object, $params)
{
  return '&amp;lt;a href=&amp;quot;'.url_for($this-&amp;gt;getUrlForAction('custom')).'&amp;quot; onclick=&amp;quot;console.log(\'woohoo\'); return false;&amp;quot;&amp;gt;'.__($params['label']).'&amp;lt;/a&amp;gt;';
}
&lt;/pre&gt;


&lt;p&gt;Also, as you can see that standard helpers are available too.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/30/Customizing-actions-in-symfony-s-admin-generator#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/30/Customizing-actions-in-symfony-s-admin-generator#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1188</wfw:commentRss>
      </item>
    
  <item>
    <title>Symfony Live les 11 et 12 Juin 2009</title>
    <link>http://mirmodynamics.com/post/2009/03/20/Symfony-Live-les-11-et-12-Juin-2009</link>
    <guid isPermaLink="false">urn:md5:de4bad71148b72520a75a1aefe0f9039</guid>
    <pubDate>Fri, 20 Mar 2009 20:07:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>conferences</category><category>event</category><category>peaceandlove</category><category>sensiolabs</category><category>symfony</category><category>symfonylive</category>    
    <description>    &lt;p&gt;&lt;a href=&quot;http://www.sensiolabs.com/blog/post/2009/03/20/Symfony-Live-%3A-Conf%C3%A9rence-francophone-sur-Symfony-%C3%A0-Paris-les-11-12-juin-2009&quot;&gt;Sensio Labs organise les 11 et 12 juin l'événement Symfony Live&lt;/a&gt;. Voilà tout est presque dit, cliquouillez le lien pour plus d'infos.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://mirmodynamics.com/public/2a20t-ade6528d35d0a31fff8eb9e2cb5cab1d.49c3e987-original.jpg&quot; alt=&quot;Symfony Live Flyer&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Symfony Live Flyer, Mar 2009&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/20/Symfony-Live-les-11-et-12-Juin-2009#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/20/Symfony-Live-les-11-et-12-Juin-2009#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1185</wfw:commentRss>
      </item>
    
  <item>
    <title>Automatically cd to a symfony project's root in vim</title>
    <link>http://mirmodynamics.com/post/2009/03/18/Automatically-cd-to-a-symfony-project-s-root-in-vim</link>
    <guid isPermaLink="false">urn:md5:61347ede04eb1bebad2f907168976ff4</guid>
    <pubDate>Wed, 18 Mar 2009 14:10:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>ctags</category><category>gist</category><category>root</category><category>script</category><category>symfony</category><category>vim</category>    
    <description>    &lt;p&gt;I made a little vimscript to automatically cd to the project root of a symfony project. It makes it easier for me to use the ctags :-)&lt;/p&gt;

&lt;pre&gt;
&amp;quot;-------------------------------------------------------------------------------
&amp;quot;  Description: Finds and cd to the symfony root of the project
&amp;quot;    Copyright: Copyright (C) 2009 Geoffrey Bachelet
&amp;quot;   Maintainer: Geoffrey Bachelet
&amp;quot;      Version: 1.0
&amp;quot;-------------------------------------------------------------------------------

if exists('find_symfony_root_loaded')
  finish
endif

let find_symfony_root_loaded = 1

if ! exists('find_symfony_root_symfony_executable')
  let find_symfony_root_symfony_executable = 'symfony'
endif

&amp;quot; root detection when opening a new vim seems to work
&amp;quot; only if these two events are bound. not sure why.
autocmd BufWinEnter,BufRead * call FindSymfonyRoot()

function FindSymfonyRoot()
  let l:cwd = GetAbsoluteDirname(@%)
  let l:symfony_root = findfile(g:find_symfony_root_symfony_executable, l:cwd.';')
  let l:symfony_root = GetAbsoluteDirname(l:symfony_root)
  if strlen(l:symfony_root) != 0
    execute 'cd '.l:symfony_root
  endif
endfunction

function GetAbsoluteDirname(path)
  let l:path = a:path
  &amp;quot; gets the dirname
  if !isdirectory(l:path)
    let l:path = strpart(l:path, 0, strridx(l:path, '/'))
  endif

  &amp;quot; makes it absolute
  if match(l:path, '/') != 0
    let l:path = getcwd().'/'.l:path
  endif

  return l:path
endfunction
&lt;/pre&gt;


&lt;p&gt;note for later: add vimscript support to geshi&lt;/p&gt;


&lt;p&gt;Or see &lt;a href=&quot;http://gist.github.com/81105&quot;&gt;the highlighted version on gist&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/18/Automatically-cd-to-a-symfony-project-s-root-in-vim#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/18/Automatically-cd-to-a-symfony-project-s-root-in-vim#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1184</wfw:commentRss>
      </item>
    
  <item>
    <title>How to render a partial in an action with symfony 1.1+</title>
    <link>http://mirmodynamics.com/post/2009/03/12/How-to-render-a-partial-in-an-action-with-symfony-1.1</link>
    <guid isPermaLink="false">urn:md5:58fcdf11f847730d1a68596cafcde372</guid>
    <pubDate>Thu, 12 Mar 2009 12:29:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>1.1</category><category>1.2</category><category>action</category><category>partial</category><category>render</category><category>symfony</category>    
    <description>    &lt;pre&gt;
[php]
public function executeFoobar()
{
  return $this-&amp;gt;renderPartial('my_partial');
}
&lt;/pre&gt;


&lt;p&gt;This is an attempt to take over the first place on google for the query &lt;em&gt;how to render partial action symfony&lt;/em&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/12/How-to-render-a-partial-in-an-action-with-symfony-1.1#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/12/How-to-render-a-partial-in-an-action-with-symfony-1.1#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1182</wfw:commentRss>
      </item>
    
  <item>
    <title>Using the timestamp data type in doctrine fixtures</title>
    <link>http://mirmodynamics.com/post/2009/03/10/Using-the-timestamp-data-type-in-doctrine-fixtures</link>
    <guid isPermaLink="false">urn:md5:176b6a1c1d7c2471e40780c650506039</guid>
    <pubDate>Tue, 10 Mar 2009 18:55:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>doctrine</category><category>fixtures</category><category>symfony</category><category>timestamp</category>    
    <description>    &lt;p&gt;Please note that to be valid, you have to enclose the value within single quotes. For example, say you have the following (totally useless) schema:&lt;/p&gt;

&lt;pre&gt;
Foobar:
  columns:
    published_at: { type: timestamp }
&lt;/pre&gt;


&lt;p&gt;And you want to create fixtures for this table. You might go this way (please also note that symfony allows php in fixtures files):&lt;/p&gt;

&lt;pre&gt;
Foobar:
  foobar_1:
    published_at: &amp;lt;?php echo time(); ?&amp;gt;
&lt;/pre&gt;


&lt;p&gt;Which won't work, since the &lt;code&gt;Doctrine_Validator_Timestamp&lt;/code&gt; expects a date in the &lt;code&gt;Y-m-d H:i:s&lt;/code&gt; format. So maybe you'll try this one:&lt;/p&gt;

&lt;pre&gt;
    published_at: &amp;lt;?php echo date('Y-m-d H:i:s'); ?&amp;gt;
&lt;/pre&gt;


&lt;p&gt;Which still doesn't work, since the value gets converted to an unix timestamp.&lt;/p&gt;


&lt;p&gt;The right way is (note the enclosing single quotes):&lt;/p&gt;

&lt;pre&gt;
   published_at: '&amp;lt;?php echo date('Y-m-d H:i:s'); ?&amp;gt;'
&lt;/pre&gt;


&lt;p&gt;Yay o//&lt;/p&gt;


&lt;p&gt;This &lt;em&gt;behavior&lt;/em&gt; is explained in &lt;a href=&quot;http://trac.doctrine-project.org/ticket/1716&quot;&gt;this ticket might help&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/03/10/Using-the-timestamp-data-type-in-doctrine-fixtures#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/03/10/Using-the-timestamp-data-type-in-doctrine-fixtures#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1181</wfw:commentRss>
      </item>
    
  <item>
    <title>symfony api opensearch plugin</title>
    <link>http://mirmodynamics.com/post/2009/02/25/symfony-api-opensearch-plugin</link>
    <guid isPermaLink="false">urn:md5:e449070cd708b21673c69220a5804736</guid>
    <pubDate>Wed, 25 Feb 2009 00:08:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>api</category><category>documentation</category><category>opensearch</category><category>symfony</category>    
    <description>    &lt;p&gt;In case you didn't notice, as of today (well, yesterday really) the symfony's api documentation features an opensearch plugin with autocompletion, that you can use straight from the  comfort of your favorite browser (given that it supports the opensearch standard, which is the case for at least firefox and IE, although you won't get autocomplete in this last case).&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.symfony-project.org/blog/2009/02/24/opensearch-support-for-the-symfony-api&quot;&gt;More informations on the symfony blog&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/02/25/symfony-api-opensearch-plugin#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/02/25/symfony-api-opensearch-plugin#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1178</wfw:commentRss>
      </item>
    
  <item>
    <title>symfony: use your own View class</title>
    <link>http://mirmodynamics.com/post/2009/02/23/symfony%3A-use-your-own-View-class</link>
    <guid isPermaLink="false">urn:md5:1ee2dba1b9237504be3a017c9a957bd2</guid>
    <pubDate>Mon, 23 Feb 2009 20:57:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>configuration</category><category>extending</category><category>module.yml</category><category>sfConfig</category><category>sfPHPView</category><category>symfony</category><category>view</category>    
    <description>    &lt;p&gt;The view class name in symfony is determined per-module, it means that you need to use a module-level configuration setting via the &lt;code&gt;module.yml&lt;/code&gt; configuration file. Say you want to use the &lt;code&gt;myView&lt;/code&gt; class to handle your view in the &lt;code&gt;default&lt;/code&gt; module of your &lt;code&gt;frontend&lt;/code&gt; application, create the file &lt;code&gt;sf_root_dir/apps/frontend/config/module.yml&lt;/code&gt; and put the following in it:&lt;/p&gt;

&lt;pre&gt;
default:
  view_class:  my
&lt;/pre&gt;


&lt;p&gt;Symfony will add the &lt;code&gt;View&lt;/code&gt; suffix for you. Of course, you have to take care of making this class available to the framework. The &lt;code&gt;sf_root_dir/apps/frontend/lib/myView.class.php&lt;/code&gt; file would be a good place for this.&lt;/p&gt;


&lt;p&gt;As often with &lt;code&gt;sfConfig&lt;/code&gt;, you could have put the &lt;code&gt;module.yml&lt;/code&gt; config file in &lt;code&gt;sf_root_dir/config/&lt;/code&gt; to make it global to your whole project.&lt;/p&gt;


&lt;p&gt;&lt;acronym&gt;PS&lt;/acronym&gt;: extending the &lt;code&gt;sfPHPView&lt;/code&gt; class could be a good idea to get you started too ;)&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/02/23/symfony%3A-use-your-own-View-class#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/02/23/symfony%3A-use-your-own-View-class#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1175</wfw:commentRss>
      </item>
    
  <item>
    <title>Multiple domains for one symfony project, the basics, config file version</title>
    <link>http://mirmodynamics.com/post/2009/01/19/Multiple-domains-for-one-symfony-project%2C-the-basics%2C-config-file-version</link>
    <guid isPermaLink="false">urn:md5:d1988ef40eb48bba444de255d9def1cb</guid>
    <pubDate>Thu, 22 Jan 2009 22:02:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>cache</category><category>carshop</category><category>config</category><category>dispatcher</category><category>doctrine</category><category>howto</category><category>multidomain</category><category>symfony</category>    
    <description>    &lt;p&gt;When I published my post about &lt;a href=&quot;http://mirmodynamics.com/post/2008/12/22/Multiple-domains-for-one-symfony-project%2C-the-basics&quot;&gt;using a single symfony application to serve multiple domains&lt;/a&gt; using a database to store the site-specific data, there was some people to complain about the extra query you get on each request. Right. Using a (cached) config file instead is not that hard as long as you use it only to match a domain name against a numeric id. Storing more site-specific data is a bit more problematic, but we will solve this in a later post.&lt;/p&gt;


&lt;p&gt;And because I'm lazy, I won't re-write the entire article, just highlight the differences between the two methods, so you might as well read &lt;a href=&quot;http://mirmodynamics.com/post/2008/12/22/Multiple-domains-for-one-symfony-project%2C-the-basics&quot;&gt;the database version&lt;/a&gt; if you did not already.&lt;/p&gt;


&lt;p&gt;Now, first thing, the config file. We will create a simple project-wide config file: &lt;code&gt;/config/app.yml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
all:
  paris.carshop: 1
  auckland.carshop: 2
&lt;/pre&gt;


&lt;p&gt;Then we detect the site and add a generic &lt;code&gt;sfConfig&lt;/code&gt; entry for it. This is done, as before, in &lt;code&gt;/config/ProjectConfiguration.class.php&lt;/code&gt;. We will only change the &lt;code&gt;detectSite()&lt;/code&gt; method to take advantage of the cached config information:&lt;/p&gt;

&lt;pre&gt;
[php]
  public function detectSite(sfEvent $event)
  {
    sfConfig::add(array('site_id' =&amp;gt; sfConfig::get('app_'.$_SERVER['HTTP_HOST'])));
  }
&lt;/pre&gt;


&lt;p&gt;Easy heh ?&lt;/p&gt;


&lt;p&gt;Now we just have to adapt the model classes to use this config entry. The &lt;code&gt;CarTable::createQuery()&lt;/code&gt; method will look like:&lt;/p&gt;

&lt;pre&gt;
[php]
/**
 * Creates a query, adding the site criteria automatically
 *
 * @return Doctrine_Query
 * @see Doctrine_Table::createQuery()
 */

public function createQuery($alias = '')
{
  $query = parent::createQuery($alias);
  $query-&amp;gt;where('site_id = ?', sfConfig::get('site_id'));
  
  return $query;
}
&lt;/pre&gt;


&lt;p&gt;The &lt;code&gt;Car::save()&lt;/code&gt; method:&lt;/p&gt;

&lt;pre&gt;
[php]
/**
 * Automatically populates the site_id field if necessary
 * 
 * @see sfDoctrineRecord::save()
 */

public function save(Doctrine_Connection $conn = null)
{
  if (empty($this-&amp;gt;site_id))
  {
    $this-&amp;gt;setSiteId(sfConfig::get('site_id'));
  }

  return parent::save();
}
&lt;/pre&gt;


&lt;p&gt;And you're all set ! For the record, here are the other modified files from the last post:&lt;/p&gt;


&lt;p&gt;&lt;code&gt;config/doctrine/schema.yml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
Car:
  columns:
    site_id:      { type: integer }
    name:         { type: string(255) }
    description:  { type: clob }
    image:        { type: string(255) }
&lt;/pre&gt;


&lt;p&gt;&lt;code&gt;data/fixtures/&lt;/code&gt; now contains only the &lt;code&gt;Car&lt;/code&gt; fixtures:&lt;/p&gt;

&lt;pre&gt;
Car:
  car_1:
    site_id: 1
    name: Peugeot 307
    description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  car_2:
    site_id: 1
    name: Renault Laguna
    description: Maecenas tortor nunc, aliquam et, ultrices id, ornare consectetur, mauris.
  car_3:
    site_id: 2
    name: Subaru Impreza
    description: Ut accumsan diam et orci. Sed sit amet neque ac diam rutrum iaculis.
&lt;/pre&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2009/01/19/Multiple-domains-for-one-symfony-project%2C-the-basics%2C-config-file-version#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2009/01/19/Multiple-domains-for-one-symfony-project%2C-the-basics%2C-config-file-version#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1169</wfw:commentRss>
      </item>
    
  <item>
    <title>Multiple domains for one symfony project, the basics</title>
    <link>http://mirmodynamics.com/post/2008/12/22/Multiple-domains-for-one-symfony-project%2C-the-basics</link>
    <guid isPermaLink="false">urn:md5:9fbb9dbd582af2cc7fb3a7b9f201cd6a</guid>
    <pubDate>Mon, 29 Dec 2008 11:10:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>apache</category><category>carshop</category><category>dispatcher</category><category>doctrine</category><category>howto</category><category>mod_rewrite</category><category>multidomain</category><category>symfony</category>    
    <description>    &lt;p&gt;So let's say you run a car franchise, and you have several shops that you want to be able to manage through a web application. The application would be same for each shop, except you'd have to manage different sets of data and have specific assets for each shop. Fear not, this is very easy to achieve using symfony (well, it's quite easy with any framework I guess, but we will be using symfony :p)&lt;/p&gt;


&lt;h3&gt;Sample project&lt;/h3&gt;


&lt;p&gt;At the beginning, there were &lt;code&gt;generate:project&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
$ mkdir carshop
$ cd carshop
$ symfony generate:project carshop
$ symfony generate:app frontend
$ symfony generate:module frontend default
&lt;/pre&gt;


&lt;p&gt;We will also need a simple database schema for the sake of examples. We will be using Doctrine, so let's fill in our &lt;code&gt;config/doctrine/schema.yml&lt;/code&gt; with a very simple schema:&lt;/p&gt;

&lt;pre&gt;
[yml]
detect_relations: true

Car:
  columns:
    site_id:      { type: integer }
    name:         { type: string(255) }
    description:  { type: clob }
    image:        { type: string(255) }

Site:
  columns:
    name:         { type: string(255) }
    domain:       { type: string(255), unique: true }
    main:           { type: boolean, default: false }
&lt;/pre&gt;


&lt;p&gt;Also, let's not forget to enable Doctrine in our project in &lt;code&gt;config/ProjectConfiguration.class.php&lt;/code&gt;, replace the line:&lt;/p&gt;

&lt;pre&gt;
[php]
$this-&amp;gt;enableAllPluginsExcept('sfDoctrinePlugin');
&lt;/pre&gt;


&lt;p&gt;with:&lt;/p&gt;

&lt;pre&gt;
[php]
$this-&amp;gt;enableAllPluginsExcept('sfPropelPlugin');
&lt;/pre&gt;


&lt;p&gt;and to configure the database:&lt;/p&gt;

&lt;pre&gt;
$ symfony configure:database --name=doctrine --class=sfDoctrineDatabase &amp;quot;mysql:host=localhost;dbname=carshop&amp;quot; root
&lt;/pre&gt;


&lt;p&gt;Oh, we shall need some fixtures too, let's put them in &lt;code&gt;data/fixtures/01_sites.yml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
[yml]
Site:
  paris:
    name: Paris
    domain: paris.carshop
  auckland:
    name: Auckland
    domain: auckland.carshop
&lt;/pre&gt;


&lt;p&gt;and &lt;code&gt;data/fixtures/02_cars.yml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
[yml]
Car:
  car_1:
    Site: paris
    name: Peugeot 307
    description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  car_2:
    Site: paris
    name: Renault Laguna
    description: Maecenas tortor nunc, aliquam et, ultrices id, ornare consectetur, mauris.
  car_3:
    Site: auckland
    name: Subaru Impreza
    description: Ut accumsan diam et orci. Sed sit amet neque ac diam rutrum iaculis.
&lt;/pre&gt;


&lt;p&gt;And now that everything is ready, let's create the tables and load the fixtures:&lt;/p&gt;

&lt;pre&gt;
$ symfony doctrine:build-all-load
&lt;/pre&gt;


&lt;h4&gt;Vhosts&lt;/h4&gt;


&lt;p&gt;The second thing we will need is a set of vhost with differents domains all pointing to our newly generated project. It's quite easy to do, and I will assume you run some kind of linux or unix here (although it's similar under windows if I remember well). Let's start with creating fake domain names, you just have to add the following line to your &lt;code&gt;/etc/hosts&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
127.0.0.1 auckland.carshop paris.carshop
&lt;/pre&gt;


&lt;p&gt;And the following to your apache vhost:&lt;/p&gt;

&lt;pre&gt;
[apache]
ServerName paris.carshop
ServerAlias *.carshop
&lt;/pre&gt;


&lt;p&gt;Save and quit, reload apache, and you're all set.&lt;/p&gt;


&lt;h3&gt;Detecting the current site&lt;/h3&gt;


&lt;p&gt;First thing we need to know if we want to handle site-specific data, is which site we're currently in. This can easily be done in the project configuration. Since we will need database access, we will hook up on the &lt;code&gt;context.load_factories&lt;/code&gt; event. So, on with coding, open your &lt;code&gt;config/ProjectConfiguration.class.php&lt;/code&gt; and add the following line to the &lt;code&gt;setup()&lt;/code&gt; method:&lt;/p&gt;

&lt;pre&gt;
[php]
$this-&amp;gt;dispatcher-&amp;gt;connect('context.load_factories', array($this, 'detectSite'));
&lt;/pre&gt;


&lt;p&gt;This will hook the &lt;code&gt;detectSite()&lt;/code&gt; method to the event &lt;code&gt;context.load_factories&lt;/code&gt;. We now need to add the &lt;code&gt;detectSite()&lt;/code&gt; method to the &lt;code&gt;ProjectConfiguration&lt;/code&gt; class:&lt;/p&gt;

&lt;pre&gt;
[php]
/**
 * Detects the current site based on the url
 * Fallback to the main site (main = 1 in database) if we can't find a suitable entry
 *
 * @param sfEvent $event
 */

public function detectSite(sfEvent $event)
{
  $request = sfContext::getInstance()-&amp;gt;getRequest();
  $domain = $request-&amp;gt;getHost();

  $siteTable = Doctrine::getTable('Site');

  if (false !== $site = $siteTable-&amp;gt;retrieveByDomain($domain))
  {
    $siteTable-&amp;gt;setCurrent($site);
  }
  else
  {
    $siteTable-&amp;gt;setCurrent($siteTable-&amp;gt;retrieveMain());
  }
}
&lt;/pre&gt;


&lt;p&gt;Nothing very hard here. We get the HTTP host from the request, then try to fetch a corresponding Site from the database, fallbacking to the main site if necessary. You may have noticed that we added three methods to the &lt;code&gt;Site&lt;/code&gt; model class: &lt;code&gt;retrieveByDomain()&lt;/code&gt;, &lt;code&gt;retrieveMain()&lt;/code&gt; and &lt;code&gt;setCurrent()&lt;/code&gt;. Your &lt;code&gt;lib/model/doctrine/SiteTable.class.php&lt;/code&gt; should look like this now:&lt;/p&gt;

&lt;pre&gt;
[php]
&amp;lt;?php
/**
 * This class has been auto-generated by the Doctrine ORM Framework
 */
class SiteTable extends Doctrine_Table
{

  /**
   * Holds the current site
   * @var Site
   */

  protected $current;

  /**
   * Retrieve a Site by its domain
   *
   * @param string $domain
   * @return Site or false if no site is found
   */

  public function retrieveByDomain($domain)
  {
    return $this-&amp;gt;createQuery()-&amp;gt;where('domain = ?', $domain)-&amp;gt;fetchOne();
  }

  /**
   * Retrieve the main site
   *
   * @return Site or false if no site is found
   */

  public function retrieveMain()
  {
    return $this-&amp;gt;createQuery()-&amp;gt;where('main = 1')-&amp;gt;fetchOne();
  }
  

  /**
   * Sets the current site
   *
   * @param Site $site
   */

  public function setCurrent(Site $site)
  {
    $this-&amp;gt;current = $site;
  }

}
&lt;/pre&gt;


&lt;p&gt;While we're there, let's add a &lt;code&gt;getCurrent()&lt;/code&gt; method as well:&lt;/p&gt;

&lt;pre&gt;
[php]
/**
 * Gets the current site
 *
 * @return Site
 */

public function getCurrent()
{
  return $this-&amp;gt;current;
}
&lt;/pre&gt;



&lt;h3&gt;Handling domain-specific logic and data&lt;/h3&gt;


&lt;p&gt;Ok, so now that we know where we are, let's make the Car model aware of the current site. Open &lt;code&gt;lib/model/doctrine/CarTable.class.php&lt;/code&gt; and add the &lt;code&gt;createQuery()&lt;/code&gt; method:&lt;/p&gt;

&lt;pre&gt;
[php]
/**
 * Creates a query, adding the site criteria automatically
 *
 * @return Doctrine_Query
 * @see Doctrine_Table::createQuery()
 */

public function createQuery($alias = '')
{
  $query = parent::createQuery($alias);
  $query-&amp;gt;where('site_id = ?', Doctrine::getTable('Site')-&amp;gt;getCurrent()-&amp;gt;getId());
  
  return $query;
}
&lt;/pre&gt;


&lt;p&gt;This is the method used internally by &lt;code&gt;Doctrine_Table&lt;/code&gt; to create queries related to the Car model, so now, all &lt;code&gt;find&lt;/code&gt; methods fired from the Car model will only fetch cars from the current site. We need to take care of this at &lt;code&gt;save()&lt;/code&gt; time too, in &lt;code&gt;lib/model/doctrine/Car.class.php&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
[php]
/**
 * Automatically populates the site_id field if necessary
 * 
 * @see sfDoctrineRecord::save()
 */

public function save(Doctrine_Connection $conn = null)
{
  if (empty($this-&amp;gt;site_id))
  {
    $this-&amp;gt;setSite(Doctrine::getTable('Site')-&amp;gt;getCurrent());
  }

  return parent::save();
}
&lt;/pre&gt;


&lt;h3&gt;Handling domain specific assets&lt;/h3&gt;


&lt;p&gt;On with the assets. We are going to use our good friend &lt;code&gt;mod_rewrite&lt;/code&gt; to handle this. First, let's create a specific directory for each domain we're going to manage:&lt;/p&gt;

&lt;pre&gt;
$ mkdir -p web/perhost/{paris,auckland}.carshop/{css,images,js,uploads}
&lt;/pre&gt;


&lt;p&gt;Also, for testing purpose, let's create some fake js file:&lt;/p&gt;

&lt;pre&gt;
$ echo 'paris.carshop' &amp;gt; web/perhost/paris.carshop/js/foo.js
$ echo 'auckland.carshop' &amp;gt; web/perhost/auckland.carshop/js/foo.js
$ echo 'fallback' &amp;gt; web/js/fallback.js
&lt;/pre&gt;


&lt;p&gt;Then add some voodoo magic in your &lt;code&gt;web/.htaccess&lt;/code&gt;, before the &lt;em&gt;we skip all files with .something&lt;/em&gt; rules generated by symfony:&lt;/p&gt;

&lt;pre&gt;
[apache]
RewriteCond /home/ash/projects/carshop/trunk/web/perhost/%{HTTP_HOST}%{REQUEST_FILENAME} -f
RewriteRule (.*) /perhost/%{HTTP_HOST}/$1 [L]
&lt;/pre&gt;


&lt;p&gt;Please note that &lt;code&gt;%{REQUEST_FILENAME}&lt;/code&gt; includes the starting &lt;code&gt;/&lt;/code&gt;, so that we don't need to add one after &lt;code&gt;%{HTTP_HOST}&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Now check that you have &lt;code&gt;mod_rewrite&lt;/code&gt; enabled (for example check that &lt;code&gt;/etc/apache2/mods-enable/rewrite.load&lt;/code&gt; exists). If it's not enabled it, do it now:&lt;/p&gt;

&lt;pre&gt;
$ sudo a2enmod rewrite
$ sudo /etc/init.d/apache2 reload
&lt;/pre&gt;


&lt;p&gt;You can test the following urls to see if everything is going well, the results should be pretty obvious:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://paris.carshop/js/foo.js&quot; title=&quot;http://paris.carshop/js/foo.js&quot;&gt;http://paris.carshop/js/foo.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://auckland.carshop/js/foo.js&quot; title=&quot;http://auckland.carshop/js/foo.js&quot;&gt;http://auckland.carshop/js/foo.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://paris.carshop/js/fallback.js&quot; title=&quot;http://paris.carshop/js/fallback.js&quot;&gt;http://paris.carshop/js/fallback.js&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;See you next time !&lt;/h3&gt;


&lt;p&gt;Now you have a working multi-domain architecture for your symfony project, but there are still a couple of things we could (and will) discuss:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;uploading assets (from forms for example)&lt;/li&gt;
&lt;li&gt;having a different layout for each site&lt;/li&gt;
&lt;li&gt;having specific css files for each site (eg: paris.css and auckland.css)&lt;/li&gt;
&lt;li&gt;cache problematic for shared assets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All these points will be addressed in the next part of this tutorial, but not before 2009 has came !&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2008/12/22/Multiple-domains-for-one-symfony-project%2C-the-basics#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2008/12/22/Multiple-domains-for-one-symfony-project%2C-the-basics#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1163</wfw:commentRss>
      </item>
    
  <item>
    <title>sfConsolePlugin, a console plugin for symfony</title>
    <link>http://mirmodynamics.com/post/2008/12/17/sfConsolePlugin%2C-a-console-plugin-for-symfony</link>
    <guid isPermaLink="false">urn:md5:b740e71397937f5de67118ce230981aa</guid>
    <pubDate>Wed, 17 Dec 2008 23:30:00 +0100</pubDate>
    <dc:creator>Geoffrey</dc:creator>
        <category>Symfony</category>
        <category>console</category><category>php</category><category>plugin</category><category>sfConsolePlugin</category><category>symfony</category>    
    <description>    &lt;p&gt;I've just release the first beta of my first symfony plugin: &lt;a href=&quot;http://www.symfony-project.org/plugins/sfConsolePlugin&quot;&gt;sfConsolePlugin&lt;/a&gt;. This plugins provides a PHP shell, with tab-completion, history support, and symfony capabilities. To install and use it, you need symfony 1.2 and the readline extension. From your project root:&lt;/p&gt;

&lt;pre&gt;
$ ./symfony plugin:install sfConsolePlugin --release=0.0.2
$ ./symfony console:run
&lt;/pre&gt;


&lt;p&gt;see &lt;a href=&quot;http://www.symfony-project.org/plugins/sfConsolePlugin/0_0_2?tab=plugin_readme&quot;&gt;the README file&lt;/a&gt; for more info.&lt;/p&gt;</description>
    
    
    
          <comments>http://mirmodynamics.com/post/2008/12/17/sfConsolePlugin%2C-a-console-plugin-for-symfony#comment-form</comments>
      <wfw:comment>http://mirmodynamics.com/post/2008/12/17/sfConsolePlugin%2C-a-console-plugin-for-symfony#comment-form</wfw:comment>
      <wfw:commentRss>http://mirmodynamics.com/feed/atom/comments/1162</wfw:commentRss>
      </item>
    
  <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>
    
</channel>
</rss>