<?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/"
xmlns:series="http://unfoldingneurons.com/"
><channel><title>Larry Ullman &#187; framework</title> <atom:link href="http://www.larryullman.com/tag/framework/feed/" rel="self" type="application/rss+xml" /><link>http://www.larryullman.com</link> <description>Translating Geek Into English</description> <lastBuildDate>Mon, 21 May 2012 11:03:07 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Working with Layouts in Yii</title><link>http://www.larryullman.com/2012/05/16/working-with-layouts-in-yii/</link> <comments>http://www.larryullman.com/2012/05/16/working-with-layouts-in-yii/#comments</comments> <pubDate>Wed, 16 May 2012 11:00:20 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[yii]]></category> <category><![CDATA[yiiframework]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3196</guid> <description><![CDATA[Using the Model-View-Controller (MVC) design pattern, the look of a Yii-based site is naturally controlled by the View files. These files are a combination of HTML and PHP that help to create the desired output. Specific pages in a site will use specific View files. In fact, the View files are designed to be broken [...]]]></description> <content:encoded><![CDATA[<p>Using the <a
href="http://en.wikipedia.org/wiki/Model–view–controller">Model-View-Controller (MVC)</a> design pattern, the look of a <a
href="http://www.yiiframework.com">Yii</a>-based site is naturally controlled by the View files. These files are a combination of HTML and PHP that help to create the desired output. Specific pages in a site will use specific View files. In fact, the View files are designed to be broken down quite atomically, such that, for example, the form used to both create and edit an employee record is its own file, and that file can be included by both <strong>create.php</strong> and <strong>update.php</strong>. As with most things in OOP, implementing atomic, <a
href="http://ezinearticles.com/?The-Importance-of-Decoupled-Objects-in-OOP&amp;id=4073112">decoupled</a> functionality goes a long way towards improving reusability. But the individual View files are only part of the equation for rendering a Web page. Individual view files get rendered within a <em>layout</em> file. And although I&#8217;ve mentioned layouts a time or two in my writings on Yii, it&#8217;s a subject that deserves its own post.<span
id="more-3196"></span></p><p>To be clear, layouts <em>are</em> a type of View file. Specifically, whereas other View files get placed within a directory for the corresponding Controller (i.e., the <strong>SiteController</strong> pulls from <strong>views/site</strong>), layout files go within <strong>views/layouts</strong>. But while the other View files are associated with individual Controllers (and therefore, individual pages), layouts are communal, shared by all the pages. Simply put, a layout file is the parent wrapper for the entire site&#8217;s templating system. I&#8217;ll explain&#8230;</p><h2>The Premise of Templates</h2><p>When you begin creating dynamic Web sites using PHP, you&#8217;ll quickly recognize that many parts of an HTML page will be repeated throughout the site. For example, the opening and closing HTML and BODY tags. Even the site you&#8217;re looking at now has repeating elements: the header, the navigation, the footer, etc. To create a template system, you would pull all of those common elements out and put them into one (or more) separate files. Then each specific page can include these files around the page-specific content:</p><pre class="brush: php; title: ; notranslate">include('header.html');
// Add page-specific content.
include('footer.html'); </pre><p>This is the approach I would use on non-framework-based sites. It&#8217;s easy to generate and maintain. If you need to change the header for the entire site, you only need to edit the one file.</p><h2>Templates in Yii</h2><p>When using a framework, you&#8217;ll probably end up with a &#8220;bootstrap&#8221; approach, where all of the pages are accessed through one file. In the case of Yii, that bootstrap file is <strong>index.php</strong>. Part of its job is to manufacture the necessary HTML for the requested resource. Whereas the non-framework approach pulls the template files into the page-specific file, Yii pulls all the files from includes and assembles them together. Of these files, the layout files constitute all the common elements; everything that&#8217;s not page-specific. If you look at a Yii-generated site, you&#8217;ll see that <strong>views/layouts/main.php</strong> begins with the DOCTYPE and opening HTML tag, then has the HTML HEAD and all its jazz, then starts the BODY, and finally has the footer material and the closing tags. In the middle of the body of the code, you&#8217;ll see this line:</p><pre class="brush: php; title: ; notranslate">&lt;!--?php echo $content; ?--&gt;</pre><p>This is a magic line as it pulls in the page-specific content. If the site you&#8217;re looking at now used Yii, the value of <strong>$content</strong> would be all the HTML that makes up this post you&#8217;re reading. For a Yii example, when the user is looking at <strong>site/login</strong>, the <strong>SiteController</strong>&#8216;s <strong>actionLogin()</strong> method will be called. That method will render the <strong>views/site/login.php</strong> View page, pulling that file&#8217;s contents into the main layout file at that <strong>echo $content</strong> location. That&#8217;s what&#8217;s going on behind the scenes.</p><p>So here, then, is the first key concept: if you want to change the general look of your Web site, edit the layout file (<strong>views/layouts/main.php</strong>). If you were to take your HTML mockup for your site, drop in the <strong>echo $content;</strong> line at the right place, and save it as <strong>views/layout/main.php</strong>, you will have created a custom look for your Web app. That is the basic principle and it&#8217;s essentially that simple.</p><p>To take layouts a step further, many sites will use variations on a theme. For example, the first Yii-based site I created used one header for the home page and another header for other pages, with all the remaining common elements being consistent. Or, I worked on an e-commerce project where one category of products used layout A and another category used layout B. If you have this need, there are a couple of ways of going about it.</p><h2>Creating a Second Layout</h2><p>The first and most obvious route is to create a second layout file. In the example where the site&#8217;s home page used a variation on the template, I created <strong>views/layouts/home.php</strong>. It was based upon <strong>main.php</strong>, with the necessary edits. To dynamically switch layouts, I changed the value assigned to the <strong>layout</strong> property within the proper Controller method:</p><pre class="brush: php; title: ; notranslate">// protected/controllers/SiteController.php
public function actionIndex() {
    $this-&gt;layout = 'home';</pre><p>And that&#8217;s all there is to it. When <strong>views/site/index.php</strong> would be rendered, it&#8217;d use the <strong>views/layouts/home.php</strong> template.</p><p>Although this approach is easy to understand and implement, it has a downside: a LOT of HTML is being repeated between the two layout files. If I needed to change the navigation, I had to edit both files in the same way. This leads us to option B.</p><h2>Hijacking the Content</h2><p>More recent versions of Yii will automatically create three layout files when you create a new Web app:</p><ul><li><strong>views/layouts/column1.php</strong></li><li><strong>views/layouts/column2.php</strong></li><li><strong>views/layouts/main.php</strong></li></ul><p>Although all three are layout files, you don&#8217;t have three different template files. The <strong>main.php</strong> file still creates the DOCTYPE and HTML and HEAD and so forth. The <strong>column1.php</strong> and <strong>column2.php</strong> files simply create variations on how the page-specific content gets rendered. These files do so by hijacking the layout process. For example, here is the entirety of <strong>column1.php</strong>:</p><pre class="brush: php; title: ; notranslate">&lt;!--?php $this---&gt;beginContent('//layouts/main'); ?&gt;&lt;/pre&gt;
&lt;div id=&quot;content&quot;&gt;&lt;/div&gt;
&lt;pre&gt;
&lt;!-- content --&gt;
&lt;!--?php $this---&gt;endContent(); ?&gt;</pre><p>Again, you have the magic <strong>echo $content </strong>line there, but all <strong>column1.php</strong> does is wrap the page-specific content in a DIV.</p><p>The <strong>column2.php</strong> file starts off the same, but adds another DIV (which includes some widgets) before <strong>$this-&gt;endContent()</strong>:</p><pre class="brush: php; title: ; notranslate">&lt;!--?php $this---&gt;beginContent('//layouts/main'); ?&gt;&lt;/pre&gt;
&lt;div class=&quot;span-19&quot;&gt;
&lt;div id=&quot;content&quot;&gt;&lt;/div&gt;
&lt;!-- content --&gt;&lt;/div&gt;
&lt;div class=&quot;span-5 last&quot;&gt;
&lt;div id=&quot;sidebar&quot;&gt;&lt;!--?php  $this---&gt;beginWidget('zii.widgets.CPortlet', array(
 'title'=&gt;'Operations',
 ));
 $this-&gt;widget('zii.widgets.CMenu', array(
 'items'=&gt;$this-&gt;menu,
 'htmlOptions'=&gt;array('class'=&gt;'operations'),
 ));
 $this-&gt;endWidget();
 ?&gt;&lt;/div&gt;
&lt;!-- sidebar --&gt;&lt;/div&gt;
&lt;pre&gt;
&lt;!--?php $this---&gt;endContent(); ?&gt;</pre><p>The trick here is the call to <strong>beginContent()</strong>. Remember how the layout file echoes the page-specific content in the correct place? Well, this call to <strong>beginContent()</strong> says that we&#8217;re about to start rendering the content. The method is provided with the primary layout file to use as the parent (i.e., the layout that encapsulates this content). All that&#8217;s happened here is that the content has been hijacked and replaced with slightly modified content. So the content in <strong>views/site/login.php</strong> gets pulled into <strong>column.php</strong>, where it&#8217;s wrapped within other content, and the combination of that content gets passed to <strong>main.php</strong>.</p><p>There are two tricks to this: first, <strong>beginContent()</strong> must point to <strong>//layouts/main.php</strong>. (The // just says to start in the Views directory.) Second, the layout that the Controller thinks it&#8217;s using is <strong>column1.php</strong>, not <strong>main.php</strong>. I personally think this approach is a bit complicated, particularly for the Yii newbie (yiibie?), but it is useful in situations where the content around the page-specific content needs to be adjusted dynamically.</p><p>If you were to open <strong>components/Controller.php</strong>, you would see this line:</p><pre class="brush: php; title: ; notranslate">public $layout='//layouts/column1';</pre><p>That one line says that all Controllers (which inherit from <strong>Controller</strong>) will use <strong>column1.php</strong> as its layout. If you were to change this one line to <em>column2</em>, then all Controllers would use that as the default layout. If you were to change this one line to <em>main</em>, then all Controllers would use <strong>main.php</strong> as the default layout, without the intermediary column layouts.</p><p>Again, this is a bit more convoluted than is healthy for newbies, but layouts are just wrappers to page-specific content, whether you use a single layout or intermediary layouts such as column1 and column2. If you&#8217;d like a visual representation, there&#8217;s a useful image provided among the <a
href="http://www.yiiframework.com/wiki/249/understanding-the-view-rendering-flow/#comments">comments in this article</a>.</p><h2>Quick Guide</h2><p>To summarize what&#8217;s been covered here&#8230;</p><p>To change the entire look for the entire site, edit <strong>layouts/main.php</strong>, but be sure to use the <strong>echo $content</strong> line where appropriate.</p><p>To change the default layout for every Controller, edit this line in <strong>components/Controller.php</strong>:</p><pre class="brush: php; title: ; notranslate">public $layout='//layouts/column1';</pre><p>To change the default layout for every View in an individual Controller, add this line to that Controller&#8217;s definition:</p><pre class="brush: php; title: ; notranslate">class SiteController extends Controller {
public $layout = 'column2';</pre><p>To change the layout used for a single action, add this line to the corresponding action:</p><pre class="brush: php; title: ; notranslate">// protected/controllers/SiteController.php
public function actionIndex() {
    $this-&gt;layout = 'home';</pre><p>And remember that <strong>column1.php</strong> and <strong>column2.php</strong> just hijack the page-specific content before it gets passed on to the <strong>main.php</strong> layout file.</p><p>I hope this post has been helpful and let me know if you have any questions or problems with layouts in Yii. (And by the way, if you like this post, I&#8217;m going to be writing a book on Yii later this summer. Subscribe to my newsletter or follow me on Twitter to stay tuned!)</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/05/16/working-with-layouts-in-yii/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Under the Hood of Yii&#8217;s Component Architecture</title><link>http://www.larryullman.com/2012/03/16/under-the-hood-of-yiis-component-architecture/</link> <comments>http://www.larryullman.com/2012/03/16/under-the-hood-of-yiis-component-architecture/#comments</comments> <pubDate>Fri, 16 Mar 2012 14:13:51 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3055</guid> <description><![CDATA[If you haven&#8217;t yet seen it, Steven O&#8217;Brien wrote an in-depth series of articles on the Yii framework&#8217;s component architecture, posted at phpmaster. In the series, O&#8217;Brien looks at the CComponent base class in detail. Every class in Yii is an extension of CComponent, so understanding what it brings to the table can be quite [...]]]></description> <content:encoded><![CDATA[<p>If you haven&#8217;t yet seen it, <a
href="http://steve-obrien.com/">Steven O&#8217;Brien</a> wrote an in-depth series of articles on the Yii framework&#8217;s component architecture, posted at <a
href="http://phpmaster.com">phpmaster</a>. In the series, O&#8217;Brien looks at the <a
href="http://www.yiiframework.com/doc/api/1.1/CComponent">CComponent</a> base class in detail. Every class in Yii is an extension of <strong>CComponent</strong>, so understanding what it brings to the table can be quite useful to the Yii developer. <a
href="http://phpmaster.com/yii-under-the-hood-1/">Part 1</a> looks at the classes key properties and methods. <a
href="http://phpmaster.com/yii-under-the-hood-2/">Part 2</a> discusses events. And <a
href="http://phpmaster.com/under-the-hood-of-yii’s-component-architecture-part-3/">part 3</a> explains the behaviors. If you&#8217;re using Yii, it&#8217;s worth reading these to better understand what&#8217;s going on at the fundamental level.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/03/16/under-the-hood-of-yiis-component-architecture/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>My Yii Book Update</title><link>http://www.larryullman.com/2011/11/03/my-yii-book-update/</link> <comments>http://www.larryullman.com/2011/11/03/my-yii-book-update/#comments</comments> <pubDate>Fri, 04 Nov 2011 01:48:50 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[books]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[yii]]></category> <category><![CDATA[yiibk]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2853</guid> <description><![CDATA[I&#8217;ve received a few comments and questions lately about my intentions to write a book on the Yii framework. I&#8217;ve never formally discussed the idea, and so it seems like it&#8217;s about time I do so. I first started using the Yii framework about two and half years ago. I&#8217;ve never been much of a framework [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve received a few comments and questions lately about my intentions to write a book on the <a
href="http://yiiframework.com/">Yii framework</a>. I&#8217;ve never formally discussed the idea, and so it seems like it&#8217;s about time I do so.</p><p>I first started using the Yii framework about two and half years ago. I&#8217;ve never been much of a framework person, but Yii really felt right to me, quite similar to <a
href="http://rubyonrails.com/">Ruby on Rails</a>, which I also always liked. Being a writer, after learning to use the framework, I wrote an <a
href="http://www.larryullman.com/series/learning-the-yii-framework/">introductory series on the subject</a>, which has been quite popular. In all modesty, many have suggested it&#8217;s the best documentation available. In fact, the creator of Yii liked my series so much that he listed it prominently on the official Yii documentation page (it&#8217;s now under <a
href="http://www.yiiframework.com/tutorials/">tutorials</a>). Some time after writing that series, I started thinking about writing a full book on Yii, because <a
href="http://www.larryullman.com/books/">that&#8217;s what I do</a>.</p><p>When I decided to write a book on Yii, I figured I&#8217;d self-publish it, for a couple of reasons. First, even though I have a wonderful relationship with <a
href="http://peachpit.com/">Peachpit Press</a>, I&#8217;m not sure they&#8217;d want to do a book on Yii, as the market is kind of small. Second, even if Peachpit would publish such a book, I doubt I&#8217;d make much money on the project, considering the small market. By comparison, if I self-publish, I can make 4-5 times per book what I&#8217;d make if I went through a publisher. The higher per copy amount could be enough to make up for the smaller sales, ending up with a project that&#8217;s financially worth my time to do (sorry to be crass about the money, but writing a book is a lot of work and I do have bills to pay!). Fourth, I&#8217;ve been intrigued about self-publishing for some time. And, fifth, self-publishing would give me the opportunity to distribute the book in unique formats and channels, such as a chapter at a time.</p><p>If I had my act together (which is to say, if my life were other than it is, in about ten ways), I would have been on the ball and published this book a year or more ago. Sadly, that has not been the case. I keep fairly busy work-wise, and I don&#8217;t actually have the time (due to personal constraints) to put in 40-hour weeks, so it&#8217;s really hard to add new projects, especially on the level of an entire book. Moreover, self-publishing means no guaranteed money, so I&#8217;d have to not do paying work while not making money working on the Yii book, which is a tough situation to be in.</p><p>All that being said, <em>it is still my intention to write and self-publish a book on Yii</em>. The only question is: when? This is the question I&#8217;m getting asked a lot lately. Before I do anything towards a book on Yii, I still have to:</p><ul><li>Finish my <em>Modern JavaScript: Develop and Design</em> book (which I&#8217;m weeks late on as is)</li><li>Write one more article in support of my <em>PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)</em> [I've written two out of three articles, but I'm weeks late on that, too.]</li><li>Come up with a list of videos to do in support of my <em>Modern JavaScript: Develop and Design</em> book</li><li>Actually do those videos</li><li>Continue doing the Web development and other work I have for my clients</li></ul><p>So&#8230;yikes. Don&#8217;t get my wrong: I&#8217;m quite fortunate to be busy, but yikes! I&#8217;ll be crying if I haven&#8217;t finished all of the above by the end of this year, which means in theory I can begin the Yii book at the beginning of 2012. However, I have the third edition of my <em>PHP 5 Advanced: Visual QuickPro Guide</em> due at the end of April. That does give me four months, but I&#8217;d like actually make that deadline for a change (my publisher is wonderfully understanding, but&#8230;).</p><p>Also, along with writing the Yii book, I&#8217;m going to have to come up with a site and an ecommerce system and so forth (I already have the software that can output PDFs, ePubs, and mobis). If I&#8217;m being optimistic, perhaps in 2012 I can do two Yii chapters per month, but the <em>PHP 5 Advanced</em> book will need to be my first priority. I also don&#8217;t want to start the Yii book, get some people paying for it (in part or in whole), and then have the project drag out. I don&#8217;t know. We shall see.</p><p>I very much thank everyone for their interest in my writing a book on Yii and I hope to make that happen. If you follow the blog and/or subscribe to my newsletter, you&#8217;ll get updates as to how this is progressing, when and if it does actually progress.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/11/03/my-yii-book-update/feed/</wfw:commentRss> <slash:comments>40</slash:comments> </item> <item><title>The CodeLobster PHP IDE</title><link>http://www.larryullman.com/2011/06/23/the-codelobster-php-ide/</link> <comments>http://www.larryullman.com/2011/06/23/the-codelobster-php-ide/#comments</comments> <pubDate>Thu, 23 Jun 2011 14:48:42 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[cakephp]]></category> <category><![CDATA[codeigniter]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[ide]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[smarty]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2627</guid> <description><![CDATA[I&#8217;ve been contacted a couple of times now by the people behind CodeLobster, a PHP-centric IDE, in the hopes that I&#8217;d review/mention CodeLobster on this site. Now, CodeLobster only runs on Windows, which means I haven&#8217;t, and probably won&#8217;t, use it myself (I primarily use a Mac, only using Windows for testing purposes), but I [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been contacted a couple of times now by the people behind <a
href="http://www.codelobster.com/">CodeLobster</a>, a PHP-centric IDE, in the hopes that I&#8217;d review/mention CodeLobster on this site. Now, CodeLobster only runs on Windows, which means I haven&#8217;t, and probably won&#8217;t, use it myself (I primarily use a Mac, only using Windows for testing purposes), but I have no problems mentioning products and sites here that I don&#8217;t personally use, because such things may still be of use to you (you, whoever you are, presumably are a separate entity with your own interests, needs, etc., and are statistically more likely to be running Windows). Anyway&#8230;</p><p>So, CodeLobster is an IDE for PHP that runs on Windows. It&#8217;s available in both a free and &#8220;professional&#8221; version, the professional version costing $100 (US). The free version comes with an HTML editor and inspector, a CSS editor, a JavaScript editor, a PHP editor, and a PHP debugger. This all includes the standard features such as code completion, code collapsing, browser preview, project management, FTP, and so forth. The professional version includes all of those features, plus plug-ins for specific tools and frameworks: CakePHP, CodeIgniter, Drupal, jQuery, Joomla, Smarty, Symfony, WordPress, and Yii. In other words, the professional version gives you code completion, contextual help, and so forth for these additional tools that you may also be programming in.</p><p>As I said, I haven&#8217;t personally used it, but if you&#8217;re looking for a PHP/Web Development IDE, it may be worth checking out.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/06/23/the-codelobster-php-ide/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>Using Cookies in the Yii Framework</title><link>http://www.larryullman.com/2011/06/04/using-cookies-in-the-yii-framework/</link> <comments>http://www.larryullman.com/2011/06/04/using-cookies-in-the-yii-framework/#comments</comments> <pubDate>Sat, 04 Jun 2011 14:28:06 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[cookie]]></category> <category><![CDATA[csrf]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[security]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2552</guid> <description><![CDATA[In a previous post, I wrote about . In this one, I&#8217;ll look at using cookies. Neither is that difficult, but as with all things regarding frameworks, the solution may not be obvious at first. And there are some ways to make use cookies in Yii in a more secure manner.To create a cookie in [...]]]></description> <content:encoded><![CDATA[<p>In a previous post, I wrote about <a
href="http://www.larryullman.com/2011/05/03/using-sessions-with-the-yii-framework/">using sessions in Yii-based sites</a>. In this one, I&#8217;ll look at using cookies. Neither is that difficult, but as with all things regarding frameworks, the solution may not be obvious at first. And there are some ways to make use cookies in Yii in a more secure manner.<span
id="more-2552"></span>To create a cookie in PHP without using a framework, you just call the <a
href="http://us.php.net/setcookie">setcookie()</a> function. To create a cookie while using the Yii framework, you don&#8217;t use <strong>setcookie()</strong>, but rather create a new element in the <strong>Yii::app()-&gt;request-&gt;cookies</strong> array. (Note that sessions are stored in <strong>Yii::app()-&gt;session</strong>, but cookies are in <strong>Yii::app()-&gt;request-&gt;cookies</strong>, because cookies are part of the HTTP request a browser makes of a Web server).</p><p>What you&#8217;ll want to do to create a cookie is create a new object of type <a
href="http://www.yiiframework.com/doc/api/1.1/CHttpCookie/">CHttpCookie</a>: Yii&#8217;s class for cookies. Here, then, is the syntax for setting a cookie in Yii:</p><pre class="brush: php; title: ; notranslate">Yii::app()-&gt;request-&gt;cookies['name'] = new CHttpCookie('name', 'value');</pre><p>You must use the same <em>name</em> value in both places, replacing it with the actual cookie name. Remember that the cookie&#8217;s name, and value, are visible to users in their browsers, so one ought to be prudent about what name you use and be extra mindful of what values are being stored.</p><blockquote><p>Tip: Because the cookie&#8217;s name must be used twice in the code, you may want to consider assigning the cookie&#8217;s name to a variable that is used in both instances instead.</p></blockquote><p>Once you&#8217;ve created a cookie, you can access it (on subsequent pages, because cookies are never immediately available to the page that set them), using <strong>Yii::app()-&gt;request-&gt;cookies['name']-&gt;value</strong>. You have to use the extra <strong>-&gt;value</strong> part, because the &#8220;cookie&#8221; being created is actually an object of type <strong>CHttpCookie</strong> (and Yii, internally, takes care of actually sending the cookie to the browser and reading the received cookie from the browser).</p><p>To test if a cookie exists, just use <strong>isset()</strong> on <strong>Yii::app()-&gt;request-&gt;cookies['name']</strong>, as you would any other variable.</p><p>To delete an existing cookie, just unset the element as you would any array element:</p><pre class="brush: php; title: ; notranslate">unset(Yii::app()-&gt;request-&gt;cookies['name']);</pre><p>To delete all existing cookies (for that site), use</p><pre class="brush: php; title: ; notranslate">Yii::app()-&gt;request-&gt;cookies-&gt;clear();</pre><p>By default, cookies will be set to expire when the browser window is closed. To change that, you need to modify the properties of the cookie. You can&#8217;t do so when you create the <strong>CHttpCookie</strong> object (i.e., the only arguments to the constructor are the cookie&#8217;s name and value), so you must separately create a new object of type <strong>CHttpCookie</strong>, to be assigned to <strong>Yii::app()-&gt;request-&gt;cookies</strong> later:</p><pre class="brush: php; title: ; notranslate">$cookie = new CHttpCookie('name', 'value');</pre><p>Then adjust the <strong>expire</strong> attribute:</p><pre class="brush: php; title: ; notranslate">$cookie-&gt;expire = time() + (60*60*24); // 24 hours</pre><p>Then add the cookie to the application:</p><pre class="brush: php; title: ; notranslate">Yii::app()-&gt;request-&gt;cookies['name'] = $cookie;</pre><p>You can manipulate other cookie properties using the above syntax: <strong>domain</strong>, <strong>httpOnly</strong>, <strong>path</strong>, and <strong>secure</strong>. Each of these correspond to the arguments to the <strong>setcookie()</strong> function. (You can also manipulate the value of the cookie through <strong>$cookie-&gt;value</strong> and the cookie&#8217;s name through <strong>$cookie-&gt;name</strong>). For example, if you want to limit a cookie to a specific domain, or subdomain, use <strong>domain</strong>; to limit it to a specific folder, use <strong>path</strong>; and to only transmit the cookie over SSL, set <strong>secure</strong> to <strong>true</strong>.</p><p>You can also improve the security of your cookies by setting Yii&#8217;s <strong>enableCookieValidation</strong> to <strong>true</strong>, in the Yii configuration file:</p><pre class="brush: php; title: ; notranslate">return array(
    'components'=&gt;array(
        'request'=&gt;array(
            'enableCookieValidation'=&gt;true,
        ),
    ),
);</pre><p>Cookie validation prevents cookies from being manipulated in the browser. To accomplish that, Yii stores a hashed representation of the cookie&#8217;s value when it gets sent, and then compares the received cookie&#8217;s value to ensure they are the same. Obviously there&#8217;s extra overhead required to do this, but in some instances, the extra effort is justified by the extra security.</p><p>Finally, one good reason to use cookies in a Yii-based site, even if the site is otherwise using sessions, is to prevent <a
href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">Cross-site Request Forgery (CSRF)</a> attacks. A CSRF works like this: malicious site A has some code on it, such as an image tag whose <strong>src</strong> attribute points to a page on site B that does something meaningful: <em>http://www.example.com/page.php?action=this</em>. When any viewer loads the page on site A, the use of that <strong>src</strong> attribute has the effect of that user performing a request of the page on site B.</p><p>As an example, let&#8217;s say that an administrator at your site logs in and does whatever but doesn&#8217;t log out. The administrator therefore still has a cookie in her or his browser indicating access to the site (i.e., the user could open the browser and perform admin tasks without logging in again). Now let&#8217;s say that the <strong>src</strong> attribute on malicious site A points to a page on your site that deletes a blog posting. If the administrator with the live cookie loads that page on site A, it will have the same effect as if that administrator went to your site and requested that page directly. This is not good.</p><p>To prevent a CSRF attack on your site, first make sure that all significant form submissions use POST instead of GET. You should be using POST for any form that changes server content anyway, but a CSRF POST attack is a bit harder to pull off than a GET attack.</p><p>Second, set <strong>enableCsrfValidation</strong> to <strong>true</strong> in your configuration file:</p><pre class="brush: php; title: ; notranslate">return array(
    'components'=&gt;array(
        'request'=&gt;array(
            'enableCsrfValidation'=&gt;true,
        ),
    ),
);</pre><p>By doing this, Yii will send a cookie with a unique identifier to the user. All forms will then store that same identifier in a hidden input. The form submission will only be handled then if the two identifiers match. With the case of a CSRF attack, the two identifiers will not match because the form&#8217;s identifier will not be passed as part of the request (I hope this is clear; if not, let me know). Note that this only works if you&#8217;re using <a
href="http://www.yiiframework.com/doc/api/1.1/CHtml">CHtml</a> to create your forms (if you manually create the form tags, Yii won&#8217;t insert the necessary code for preventing CSRF attacks).</p><p>The most important thing to remember about cookies, which I&#8217;ve already stated, is that cookies are visible to the user in the browser. And unless you&#8217;re using SSL for the cookies, they are also visible to anyone else while being transmitted back and forth between the server and the client (which happens on every page request). So be careful of what gets stored in a cookie! If the data is particularly sensitive, use sessions instead of cookies.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/06/04/using-cookies-in-the-yii-framework/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>Yii vs Zend vs Code Igniter Compared</title><link>http://www.larryullman.com/2011/06/01/yii-vs-zend-vs-code-igniter-compared/</link> <comments>http://www.larryullman.com/2011/06/01/yii-vs-zend-vs-code-igniter-compared/#comments</comments> <pubDate>Wed, 01 Jun 2011 17:05:39 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[yii]]></category> <category><![CDATA[zend]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2593</guid> <description><![CDATA[I&#8217;m often asked why I like the Yii framework, which is easy enough to answer: for starters it requires PHP 5 and uses jQuery natively. Then I like how it auto-generates a lot of code and folders for you. From there, it just kind of works and makes sense to me. In other words, Yii [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m often asked why I like the <a
href="http://www.yiiframework.com">Yii framework</a>, which is easy enough to answer: for starters it requires PHP 5 and uses <a
href="http://www.jquery.com">jQuery</a> natively. Then I like how it auto-generates a lot of code and folders for you. From there, it just kind of works and makes sense to me. In other words, Yii feels right. And unless you really investigate the framework&#8217;s underpinnings, how it feels (and can you get it to do what you need to do) is a large part of the criteria in making a selection.</p><p>The question I can&#8217;t really answer is what advantage Yii has over the <em>X</em> framework. The only other PHP framework I&#8217;ve used extensively is the <a
href="http://framework.zend.com">Zend framework</a>. The Zend framework has a lot going for it and is worth anyone&#8217;s consideration. To me, its biggest asset is that you can use it piecemeal and independently (I&#8217;ve often used components of the Zend Framework in Yii-based and non-framework-based sites), but I just don&#8217;t like the Zend Framework as the basis of an entire site. It requires a lot of work, the documentation is overwhelming while still not being that great, and it just doesn&#8217;t &#8220;feel&#8221; right to me.</p><p>Anyway, the point of this post is that there&#8217;s a <a
href="http://www.sheldmandu.com/php/php-mvc-frameworks/yii-vs-zend-vs-code-igniter-compared">nice article at SHELDMANDU</a> from back in January in which the author does a great job of comparing the Yii framework with the Zend framework and <a
href="http://codeigniter.com/">Code Igniter</a> (I&#8217;ve heard many good things about Code Igniter). Moreover, the author lays out some of his criteria for what he wants in a framework, has reasonable and detailed critiques, and also specifically details why he didn&#8217;t consider other frameworks in his comparison. If you&#8217;re looking into frameworks, spend five minutes reading that article to help educate yourself as to what considerations you should have in mind during your research.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/06/01/yii-vs-zend-vs-code-igniter-compared/feed/</wfw:commentRss> <slash:comments>18</slash:comments> </item> <item><title>Using Sessions with the Yii Framework</title><link>http://www.larryullman.com/2011/05/03/using-sessions-with-the-yii-framework/</link> <comments>http://www.larryullman.com/2011/05/03/using-sessions-with-the-yii-framework/#comments</comments> <pubDate>Tue, 03 May 2011 01:16:56 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[cookie]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[session]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2353</guid> <description><![CDATA[I haven&#8217;t written much about the Yii framework lately, mostly because I&#8217;ve been working night and day on the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; book, due out late summer 2011. So I figured I&#8217;d put together another little blurb on the Yii framework (by regularly putting [...]]]></description> <content:encoded><![CDATA[<p>I haven&#8217;t written much about the <a
href="http://www.yiiframework.com">Yii framework</a> lately, mostly because I&#8217;ve been working night and day on the fourth edition of my &#8220;PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide&#8221; book, due out late summer 2011. So I figured I&#8217;d put together another little blurb on the Yii framework (by regularly putting out posts on Yii, it&#8217;ll be that much easier when I go to write a book on Yii later this summer). In this post, I&#8217;m going to talk about using sessions Yii-based sites (in a separate post, I&#8217;ll discuss cookies). While not at all hard, the topic, like quite a few things, is not obvious in Yii, or well documented.</p><p><span
id="more-2353"></span></p><p>The first thing to know about using sessions in Yii is that you don&#8217;t have to do anything to enable them, which is to say you don&#8217;t have to invoke <strong>session_start()</strong>, as you would in a standard PHP script. This is the behavior with Yii&#8217;s <strong>autoStart</strong> session property set to <em>true</em>, which is the default. Even without using <strong>session_start()</strong>, you could, of course, make use of the <strong>$_SESSION</strong> superglobal array, as you would in a standard PHP script, but it&#8217;s best when using frameworks to make total use of the framework. The Yii equivalent to <strong>$_SESSION</strong> is <strong>Yii::app()-&gt;session</strong>:</p><pre class="brush: php; title: ; notranslate">Yii::app()-&gt;session['var'] = 'value';
echo Yii::app()-&gt;session['var']; // Prints &quot;value&quot;</pre><p>And that&#8217;s all there is to it. To remove a session variable, apply <strong>unset()</strong>, as you would to any other variable:</p><pre class="brush: php; title: ; notranslate">unset(Yii::app()-&gt;session['var']);</pre><p>So&#8230;nothing really unexpected there, once you know where to find the session data. The more complex consideration is how to configure sessions for your Yii application. You can do so using the primary configuration file (<strong>protected/config/main.php</strong>). Within that, you would add a &#8220;session&#8221; element to the &#8220;components&#8221; array, wherein you customize how the sessions behave. The key attributes are:</p><ul><li><strong>autoStart</strong>, which defaults to <em>true</em> (i.e., always start sessions)</li><li><strong>cookieMode</strong>, with acceptable values of <em>none</em>, <em>allow</em>, and <em>only</em>, equating to: don&#8217;t use cookies, use cookies if possible, and only use cookies; defaults to <em>allow</em></li><li><strong>cookieParams</strong>, for adjusting the session cookie&#8217;s arguments, such as its lifetime, path, domain, and HTTPS-only</li><li><strong>gCProbability</strong>, for setting the probability of garbage collection being performance, with a default of 1, as in a 1% chance</li><li><strong>savePath</strong>, for setting the directory on the server used as the session directory, with a default of <em>/tmp</em></li><li><strong>sessionName</strong>, for setting the session&#8217;s, um, name, which defaults to <em>PHPSESSID</em></li><li><strong>timeout</strong>, for setting after how many seconds a session is considered idle, which defaults to 1440</li></ul><p>For all of these, the default values are the same as those that PHP sessions commonly run using, except for <strong>autoStart</strong>.</p><p>If your site will not be using sessions at all, you would want to disable them by adding this code to the &#8220;components&#8221; section of <strong>protected/config/main.php</strong>:</p><pre class="brush: php; title: ; notranslate">'session' =&gt; array (
    'autoStart' =&gt; false,
),</pre><p>If you are using sessions, for security purposes, you may want to change the session&#8217;s name, always require cookies, and change the save path:</p><pre class="brush: php; title: ; notranslate">'session' =&gt; array (
    'sessionName' =&gt; 'Site Access',
    'cookieMode' =&gt; 'only',
    'savePath' =&gt; '/path/to/new/directory',
),</pre><p>The save path, in case you&#8217;re not familiar with it, is where the session data is stored on the server. By default, this is a temporary directory, globally readable and writable. Every site running on the sever, if there are many (and shared hosting plans can have dozens on a single server), share this same directory. This means that any site on the server can read any other site&#8217;s stored session data. For this reason, changing the save path to a directory within your own site can be a security improvement. Alternatively, you can store the session data in a database. To do that, add this code to the &#8220;components&#8221; section of <strong>protected/config/main.php</strong>:</p><pre class="brush: php; title: ; notranslate">'session' =&gt; array (
    'class' =&gt; 'system.web.CDbHttpSession',
    'connectionID' =&gt; 'db',
    'sessionTableName' =&gt; 'actual_table_name',
),</pre><p>If you choose this route, Yii will automatically create the table if it does not exist. You can also perform any of the other session configuration changes in that code block, too.</p><p>So&#8230;what else? Frequently, for debugging purposes, and sometimes to store it in the database, I like to know the user&#8217;s current session ID. That value can be found in <strong>Yii::app()-&gt;session-&gt;sessionID</strong>.</p><p>Finally, when the user logs out, you may want to formally eradicate the session. To do so, call <strong>Yii::app()-&gt;session-&gt;clear()</strong> to remove all of the session variables. Then call <strong>Yii::app()-&gt;session-&gt;destroy(</strong>) to get rid of the actual data stored on the server.</p><p>And that&#8217;s what there is to know about using sessions with Yii, at least that&#8217;s all the key information. I hope this helps you with your Yii-based applications. As always, thanks for reading and let me know if you have any comments or questions.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/05/03/using-sessions-with-the-yii-framework/feed/</wfw:commentRss> <slash:comments>37</slash:comments> </item> <item><title>Rendering View Files in Yii</title><link>http://www.larryullman.com/2011/02/15/rendering-view-files-in-yii/</link> <comments>http://www.larryullman.com/2011/02/15/rendering-view-files-in-yii/#comments</comments> <pubDate>Tue, 15 Feb 2011 16:08:58 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[view]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2139</guid> <description><![CDATA[In the MVC architecture, the Controller reacts to a user request. In doing so, the Controller often loads an instance of a particular Model and then renders a specific View. &#8220;Rendering&#8221; just means compiling all the pieces together, including static text (HTML and such) and the output from executed PHP code. For example, when a [...]]]></description> <content:encoded><![CDATA[<p>In the MVC architecture, the Controller reacts to a user request. In doing so, the Controller often loads an instance of a particular Model and then <em>renders</em> a specific View. &#8220;Rendering&#8221; just means compiling all the pieces together, including static text (HTML and such) and the output from executed PHP code. For example, when a user goes to a page for updating a record, the Controller loads the associated record, and then renders the &#8220;update&#8221; View, which will display the pre-populated form:</p><pre class="brush: php; title: ; notranslate">public function actionUpdate($id) {
    $data=$this-&gt;loadModel($id);

    $this-&gt;render('update',array(
        'model'=&gt;$data
    ));
}</pre><blockquote><p>Note: That method would also have code in it for handling the submission of the update form, but I&#8217;m trying not to complicate the discussion.</p></blockquote><p>As you can see in that code, the <strong>render()</strong> method, defined in the <strong>CController</strong> class, is how a View file is chosen for rendering. The first argument to the method is the View file to be rendered, without its <strong>.php</strong> extension. The <strong>render()</strong> method will render the View file within the appropriate layout file. In other words, the View file will be rendered with its context. The above code renders <strong>update.php</strong>, for the associated Controller, wrapped within the <strong>views/layouts/main.php</strong> layout file (the default).</p><p>The second argument to <strong>render()</strong> is an array of data that can be sent to the View file. In the above code, the Model instance is being passed along. In <strong>update.php</strong>, references to the <strong>$model</strong> variable will refer to the loaded data (note that the View gets its variable names from the indexes used in the array).</p><p>The <strong>render()</strong> method takes an optional third argument, which is a Boolean indicating if the rendered result should be returned to the Controller instead of sent to the Web browser. This would be useful if you wanted to render the page and then send the output in an email or write it to a text file on the server (to act as a cached version).</p><p>Sometimes you&#8217;ll want to render a View file without incorporating the layout. To do that, invoke <strong>renderPartial()</strong>. For example, both the <strong>update.php</strong> and <strong>create.php</strong> View files, auto-generated by Yii, just provide a context, and then include the form file:</p><pre class="brush: php; title: ; notranslate">&lt;?php echo $this-&gt;renderPartial('_form', array('model'=&gt;$model)); ?&gt;</pre><p>Since the initial View file will have already be rendered within the layout context, the layout shouldn&#8217;t be rendered again. The <strong>renderPartial()</strong> method will render just the named View file. Its second argument, as with <strong>render()</strong>, can be used to pass data to the View file. In the above, the Model instance is passed along.</p><blockquote><p>Tip: The <strong>renderPartial()</strong> method is also used for Ajax calls, where the layout isn&#8217;t appropriate.</p></blockquote><p>As mentioned already, the file being rendered comes from the directory associated with the current Controller. For example, when updating an <strong>Employee</strong> record, the URL is something like <span
style="text-decoration: underline;">www.example.com/index.php/employee/update/id/23</span>. This calls the <strong>actionUpdate()</strong> method of the <strong>EmployeeController</strong> class (whose code is partially shown above). That method renders the &#8220;update&#8221; View, which is to say <strong>protected/views/employee/update.php</strong>. But there are rare cases where you&#8217;ll need to render View files from other subdirectories. For example, you may want to include a search form on a page, with that form found within another View directory. To change the reference point, start the View reference with a double slash, which means to start in the <strong>views</strong> folder. Then indicate the subdirectory and file, still omitting the extension:</p><pre class="brush: php; title: ; notranslate">&lt;?php echo $this-&gt;renderPartial('//search/_form'); ?&gt;</pre><p>And that&#8217;s all there is to it!</p><p>View rendering is one of the most important concepts to grasp in an MVC design. Fortunately, it&#8217;s not that hard to follow in Yii. Just remember that if you want your layout file, use <strong>render()</strong>. If not, use <strong>renderPartial()</strong>. If you need to pass data to the View file, use the second argument to send along an array, whose indexes will become the names of the variables within the View. Finally, if you need to change the include path, begin with a double slash.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/02/15/rendering-view-files-in-yii/feed/</wfw:commentRss> <slash:comments>29</slash:comments> </item> <item><title>Yii 1.1.6 Released</title><link>http://www.larryullman.com/2011/01/25/yii-1-1-6-released/</link> <comments>http://www.larryullman.com/2011/01/25/yii-1-1-6-released/#comments</comments> <pubDate>Tue, 25 Jan 2011 22:37:46 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2243</guid> <description><![CDATA[Version 1.1.6 of the Yii framework was released a few days ago. Along with bug fixes, 1.1.6 includes a couple of new features, most notably database migration and a new Query Builder. Database migration is a feature that comes from Ruby on Rails (well, that&#8217;s where I first heard of it) and it allows for [...]]]></description> <content:encoded><![CDATA[<p>Version 1.1.6 of the <a
href="http://www.yiiframework.com/">Yii framework</a> was released a few days ago. Along with bug fixes, 1.1.6 includes a couple of new features, most notably <a
href="http://www.yiiframework.com/doc/guide/1.1/en/database.migration">database migration</a> and a new <a
href="http://www.yiiframework.com/doc/guide/1.1/en/database.query-builder">Query Builder</a>. Database migration is a feature that comes from <a
href="http://www.rubyonrails.com">Ruby on Rails</a> (well, that&#8217;s where I first heard of it) and it allows for better version control. Basically database migration allows you to associate database changes with versions, so that you can better sync updates to the PHP code and the underlying database. It&#8217;s a useful tool for projects being developed by a team or in stages.</p><p>The new Query Builder is an object-oriented way to create custom SQL statements. This isn&#8217;t really a new feature (in the sense of allowing you to do something you couldn&#8217;t do before) but lets you do something you might commonly do but in a different way. See the above link for a thorough discussion and demonstration.</p><p>For some reason, the 1.1.6 release of Yii includes an article on <a
href="http://www.yiiframework.com/doc/guide/1.1/en/basics.best-practices">Best MVC Practices</a>. This isn&#8217;t really part of the framework itself, but is a useful read for anyone using Yii or other MVC approaches.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/01/25/yii-1-1-6-released/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>More of &#8220;Learning the Yii Framework&#8221; Series in French</title><link>http://www.larryullman.com/2011/01/23/more-of-learning-the-yii-framework-series-in-french/</link> <comments>http://www.larryullman.com/2011/01/23/more-of-learning-the-yii-framework-series-in-french/#comments</comments> <pubDate>Sun, 23 Jan 2011 03:17:46 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[mvc]]></category> <category><![CDATA[translate]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2236</guid> <description><![CDATA[Mémorandom, which is translating my popular “Learning the Yii Framework” into French and publishing it online, has recently posted the translated versions of two more parts in the series. The fourth part is Defining Databases for the Yii Application. The fifth part is Creating Models, Views, and Controllers in Yii. My thanks again to Nico [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.memorandom.fr/">Mémorandom</a>, which is translating my popular “<a
href="../series/learning-the-yii-framework/">Learning the Yii Framework</a>” into French and publishing it online, has recently posted the translated versions of two more parts in the series. The fourth part is <a
href="http://www.memorandom.fr/php/definir-une-base-de-donnees-pour-notre-application-yii/">Defining Databases for the Yii Application</a>. The fifth part is <a
href="http://www.memorandom.fr/php/creer-les-modeles-les-vues-et-les-controleurs-dans-yii/">Creating Models, Views, and Controllers in Yii</a>. My thanks again to Nico for the  nice words on my series and for the work in translating it!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/01/23/more-of-learning-the-yii-framework-series-in-french/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
<!-- Served from: www.larryullman.com @ 2012-05-21 14:54:05 by W3 Total Cache -->
