<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blog.kryskool.org/index.php/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/">
<channel>
  <title>Le Monde de KrysKool - smarty</title>
  <link>http://blog.kryskool.org/index.php/</link>
  <description>Mon blog</description>
  <language>fr</language>
  <copyright>KrysKool.org &amp;copy;</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>DotClear</generator>
  
    
  <item>
    <title>Faire un copyright dynamique en PHP avec Smarty</title>
    <link>http://blog.kryskool.org/index.php/post/2007/08/18/Faire-un-copyright-dynamique-en-PHP-avec-Smarty</link>
    <guid isPermaLink="false">urn:md5:6be5b55244a0d59562961ac126943910</guid>
    <pubDate>Sat, 18 Aug 2007 10:25:00 +0200</pubDate>
    <dc:creator>KrysKool</dc:creator>
        <category>php</category>
        <category>php</category><category>smarty</category>    
    <description>
        Pour faire dynamiquement changer l'année en cours lorsque l'on affiche des informations de copyright en PHP avec le moteur de template Smarty il faut utilise une variable interne {$smarty;*}.


Pour    </description>
    <content:encoded>    &lt;p&gt;Pour faire dynamiquement changer l'année en cours lorsque l'on affiche des informations de copyright en &lt;a href=&quot;http://blog.kryskool.org/index.php/tag/%3Aphp&quot;&gt;PHP&lt;/a&gt; avec le moteur de template &lt;a href=&quot;http://blog.kryskool.org/index.php/tag/smarty&quot;&gt;Smarty&lt;/a&gt; il faut utilise une variable interne &lt;strong&gt;{$smarty;*}&lt;/strong&gt;.&lt;/p&gt;


&lt;p&gt;Pour afficher les informations ci dessous ,&lt;/p&gt;


&lt;pre&gt;Copyright 2005-2007&lt;/pre&gt;


&lt;p&gt;Avec la partie &lt;ins&gt;2007&lt;/ins&gt; en dynamique et dépendant de l'année en cours,&lt;/p&gt;


&lt;p&gt;Il suffit de procéder comme ceci, avec &lt;a href=&quot;http://blog.kryskool.org/index.php/tag/smarty&quot;&gt;smarty&lt;/a&gt;.
dans le fichier template (.tpl) il faut écrire la ligne ci dessus comme suit.&lt;/p&gt;


&lt;pre&gt;Copyright 2005-{$smarty.now|date_format:'%Y'}&lt;/pre&gt;


&lt;p&gt;la variable &lt;strong&gt;$smarty.now&lt;/strong&gt; retourne la valeur correspond au nombre de secondes écoulées depuis Epoch (1 Janvier 1970)&lt;/p&gt;


&lt;p&gt;Le modificateur de variable &lt;a href=&quot;http://smarty.php.net/manual/fr/language.modifier.date.format.php&quot; hreflang=&quot;fr&quot; title=&quot;date_format&quot;&gt;date_format&lt;/a&gt; va convertir et afficher seulement l'année avec le &lt;strong&gt;%Y&lt;/strong&gt;.&lt;/p&gt;</content:encoded>
    
    

    <comments>http://blog.kryskool.org/index.php/post/2007/08/18/Faire-un-copyright-dynamique-en-PHP-avec-Smarty#comment-form</comments>
    <wfw:comment>http://blog.kryskool.org/index.php/post/2007/08/18/Faire-un-copyright-dynamique-en-PHP-avec-Smarty#comment-form</wfw:comment>
    <wfw:commentRss>http://blog.kryskool.org/index.php/feed/rss2/comments/17</wfw:commentRss>
  </item>
    
</channel>
</rss>