<?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; Web Development</title> <atom:link href="http://www.larryullman.com/category/web-development/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>What is Larry Thinking? #55 =&gt; Good Companies, Books, and Answers</title><link>http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/</link> <comments>http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#comments</comments> <pubDate>Mon, 21 May 2012 11:03:07 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[book]]></category> <category><![CDATA[hosting]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[oop]]></category> <category><![CDATA[regex]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3199</guid> <description><![CDATA[In this edition… About This Newsletter What Were You Thinking? =&#62; Ajax and Search Engines On the Web =&#62; My Web Host, ServInt On the Web =&#62; 37 Tested PHP, Perl, and JavaScript Regular Expressions On the Blog =&#62; Review of &#8220;Technical Blogging&#8221; by Antonio Cangiano Q&#38;A =&#62; Have You Changed Your Opinion of OOP? [...]]]></description> <content:encoded><![CDATA[<p>In this edition…</p><ul><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#about">About This Newsletter</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#you">What Were You Thinking? =&gt; Ajax and Search Engines</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#web1">On the Web =&gt; My Web Host, ServInt</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#web2">On the Web =&gt; 37 Tested PHP, Perl, and JavaScript Regular Expressions</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#blog">On the Blog =&gt; Review of &#8220;Technical Blogging&#8221; by Antonio Cangiano</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#qa1">Q&amp;A =&gt; Have You Changed Your Opinion of OOP?</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#qa2">Q&amp;A =&gt; Why does false equal 0?</a></li><li><a
href="http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/#news">Larry Ullman&#8217;s Book News =&gt; &#8220;PHP Advanced and Object-Oriented Programming</a></li></ul><p><span
id="more-3199"></span></p><h2 id="about">About This Newsletter</h2><p>So, in case you hadn&#8217;t noticed (or are new to the newsletter), it now has a new template. It&#8217;s a bit more involved than the previous template (two columns instead of just one), but is simpler in other ways, too. The new look will more closely match the updated scheme for <a
href="http://LarryUllman.com">LarryUllman.com</a>, whenever I get around to putting that online (aka, July). Basically what I&#8217;m going with for the updated site is a white background, minimum of images, blue for headings, and, above all, a clear presentation of content.</p><p>To create this newsletter template, I used the template builder from <a
href="http://campaignmonitor.com.">Campaign Monitor</a>, whom I use for these newsletters. Campaign Monitor costs me $30/month (US), but I really think it&#8217;s worth it. They have a good product, and the user interface they&#8217;ve created is tremendous. In any case, I&#8217;m hoping that since I used their system, the resulting template will look reasonably good on most systems and devices.</p><p>As always, questions, comments, and all feedback are much appreciated. And thanks for your interest in what I have to say and do!</p><h2 id="you">What Were You Thinking? =&gt; Ajax and Search Engines</h2><p>In my <a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#qa1">previous newsletter</a>, I answered a question about making Ajax-derived content available to search engines. Yogesh was kind enough to share a link at <a
href="https://developers.google.com/webmasters/ajax-crawling/">Google Developers</a> in which Google explains what else you can do to make Ajax-derived content indexable. Thanks, Yogesh!</p><h2 id="web1">On the Web =&gt; My Web Host, ServInt</h2><p>Since I&#8217;m dishing out accolades (e.g., Campaign Monitor), I&#8217;d like to recognize the company I use for Web hosting: <a
href="http://www.servint.net">ServInt</a>. I&#8217;ve been using ServInt for my Web hosting for almost five years now and I&#8217;m so, so happy with their service. They only provide Virtual Private Servers (VPS) and dedicating hosting, so ServInt is not for everyone. But I think their packages are reasonably priced and their customer service is excellent. Their customer service is excellent! I&#8217;m paying $50 (USD) per month and am happily doing so. I have complete control over my little area of the server and don&#8217;t have to worry about what someone else might have done that would bring my site down. I have a few sites on the server, which garner between 500,000 and 1 million page views per month, and the lowest-level Essential VPS setup handles that easily.</p><p>There are two reasons I&#8217;m mentioning ServInt now. One is that I get asked this question a lot. Although if you&#8217;re not interested in a VPS account, these companies have also been recommended in my <a
href="http://www.larryullman.com/forums/index.php?/topic/132-web-hosting-recommendation/">forums</a>:</p><ul><li><a
href="http://www.dreamhost.com">Dreamhost</a></li><li><a
href="http://www.hostduplex.com">HostDuplex</a></li><li><a
href="http://hostgator.com">HostGator</a></li></ul><p>Besides letting you all know about a good hosting company, if you&#8217;re looking for one, I wanted to thank the people that have used me as a reference when creating his or her own account with ServInt. I don&#8217;t know who has done so, but a couple of people have signed up with ServInt and mentioned me in the past few months, which gives me a small credit on my account. Thanks for that!</p><h2 id="web2">On the Web =&gt; 37 Tested PHP, Perl, and JavaScript Regular Expressions</h2><p>Some time ago I stumbled upon <a
href="http://www.virtuosimedia.com/dev/php/37-tested-php-perl-and-javascript-regular-expressions">37 Tested PHP, Perl, and JavaScript Regular Expressions</a>. This is just a list of 37 Perl-Compatible Regular Expressions (PCRE) that you can use for common purposes: credit card numbers, dates, postal codes, URLs, email addresses, and more. A good resource to have around!</p><h2 id="blog">On the Blog =&gt; Review of &#8220;Technical Blogging&#8221; by Antonio Cangiano</h2><p>I <a
href="http://www.larryullman.com/2012/05/07/review-of-technical-blogging-by-antonio-cangiano/">just recently reviewed</a> the book &#8220;<a
href="http://amzn.to/H6gFcE">Technical Blogging</a>&#8221; by <a
href="http://antoniocangiano.com/">Antonio Cangiano</a>. It&#8217;s a very good book, and one that I&#8217;m happy that I read. For more, check out the <a
href="http://www.larryullman.com/2012/05/07/review-of-technical-blogging-by-antonio-cangiano/">review on my blog</a>.</p><h2 id="qa1">Q&amp;A =&gt; Have You Changed Your Opinion of OOP?</h2><p>In response to my previous newsletter, Marten asked if I have changed my opinion about procedural vs. object-oriented programming. I suspect the question was raised in part because I&#8217;m currently working on &#8220;<a
href="http://amzn.to/M6yvzg">PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide</a>&#8220;. This is something I&#8217;ve discussed in the past, and am happy to go through again. The short answer is no, I have not changed my opinion. And here is what that opinion is:</p><blockquote><p>Procedural programming is better in some situations and OOP is better in some situations.</p></blockquote><p>This is an interesting debate, because PHP is one of the few programming languages that allows you to work procedurally or objectively. You can&#8217;t do procedural code with Java, JavaScript, or Ruby, and you can&#8217;t use objects with C. In PHP, you can <em>choose</em> to use objects or not use objects.</p><p>As for myself, obviously if I&#8217;m using JavaScript, Ruby, or ActionScript, I&#8217;m going to use objects. If I&#8217;m doing C, I&#8217;m not. On some PHP projects, I&#8217;ll use procedural code. On other PHP projects, I&#8217;ll use objects. Obviously any project I do that uses the <a
href="http://www.yiiframework.com">Yii framework</a> will use objects, as most frameworks are OOP in nature. So I&#8217;m totally comfortable with both approaches and I have no preference for one over the other, I always just try to choose the right tool for the job.</p><p>That, of course, is what we should all be doing as developers. There are very few absolutes when it comes to programming; there&#8217;s mostly just opinions. I&#8217;m sure that part of the reason it may have seemed like I didn&#8217;t care for OOP is that I don&#8217;t care for the presumption that OOP is better than procedural programming. OOP has its strengths and weaknesses, as does procedural programming. One is not categorically better or worse than the other. In PHP, which allows for both, there&#8217;s a very strong argument to being comfortable with both approaches so that you, too, can choose the right tool for each job.</p><p>This belief of mine also applies to frameworks. People who are really intro frameworks sometimes assert that programming with frameworks is vastly superior. It&#8217;s not. Not all the time, that is. For some developers, with some projects, a framework is the better choice. For some developers, with some projects, a framework would be the worse choice.</p><p>I like analogies, so I&#8217;ll end this with one: I like tools, I like working around the house and being handy. I have probably about 30 screwdrivers and four electric drill/drivers, including a relatively new, and quite powerful, impact driver. The analogy is that this impact driver (OOP) is the better way to drive a screw, but that&#8217;s patently false. The driver was much more expensive than any screwdriver, and it&#8217;s much heavier, and I need to go looking for the right bit, and I need to keep the batteries charged. And aside from all that, if I had to put a small screw into the back of a picture frame, the impact driver would be a <em>terrible</em> choice. But the same goes for the screwdriver (procedural): if I had to drive a three-inch lag bolt into a post, trying to do that with a screwdriver would be a decision I&#8217;d regret for a long, long time.</p><p>Do away with the assumptions, learn as much as you can, and always try to choose the right tool for the job.</p><h2 id="qa2">Q&amp;A =&gt; Why does false equal 0?</h2><p>Matti sent me this question via Twitter, specifically wondering what the difference is between 0 and 1 and true and false in PHP, and why false equals 0. This is a common point of confusion and cause of many bugs. However, the issue isn&#8217;t with the differences between these values but rather with how conditionals are evaluated and what equality is.</p><p>When you write any conditional in PHP, PHP needs to determine whether that conditional is true or false. For many conditionals, such as comparison, it&#8217;s pretty easy to identify true/false: is <strong>$x</strong> greater than 5 or no? Other conditionals are more subjective, though, and the language needs to define its rules for these situations. For example, <code>if ($x) {</code>. Is that conditional true or false? Well, it depends upon the value of <strong>$x</strong>, of course.</p><p>Obviously, if <strong>$x</strong> has a value of <strong>true</strong>, then the conditional is true. The same goes for <strong>$x</strong> having a value of &#8220;something&#8221;. It&#8217;s also pretty easy to decide that null is going to be treated as false. Things get tricky, though, when you have values such as 0 and an empty string. If <code>$x = 0;</code>, then should that conditional be true or false? The variable has been deliberately assigned a value, but the value is 0. Again, these are the kinds of choices that creators of a language have to make. In PHP, 0, an empty string, false, and null are all considered <em>empty</em> values, which get evaluated as false when used as the basis of a conditional.</p><p>Similarly, language designers have to make decisions as to what constitutes equality. If you compare two values of the same type—a string against a string, a number against a number, it is again easy to evaluate equality. It gets complicated when you compare values of different types: <code>if (2 == "2")</code>. That conditional compares the number 2 against the string &#8220;2&#8243;. These two values are not <em>identical</em> because of their different types, but are they equal?</p><p>To compare two different types, languages have to cast (i.e., forcibly convert) one type to the other. Generally, casting converts a value down to a simpler type. In that conditional, PHP will convert the string &#8220;2&#8243; to its numeric equivalent, which is 2. When you compare a Boolean against a non-Boolean, the non-Boolean has to be casted to a Boolean. As we&#8217;ve already seen, the empty values are treated as false in a conditional, so those values—0, an empty string, null, and false—are cast to the Boolean <strong>false</strong>. Hence, 0 does equal <strong>false</strong>.</p><p>Fortunately, programming languages tend to be pretty consistent in what gets treated as false (JavaScript also equates 0, an empty string, null, and false). The bugs arise in situations where your code tests for &#8220;truthiness&#8221; when it shouldn&#8217;t. For example, the conditional <code>if ($x) {</code> is fine unless one of the empty values is a valid value for <strong>$x</strong>. If it&#8217;s okay for <strong>$x</strong> to have a value of an empty string, you&#8217;d need to change your conditional accordingly. In PHP, the <strong>empty()</strong> function can discern between a variable just being set (i.e., assigned a value), and having a non-empty value. As another example, the <strong>strpos()</strong> function in PHP looks for a needle in a haystack, returning the starting indexed position where the needle is found. If the needle is found at the very beginning of the haystack, then the function will return 0. If you were to do this, you&#8217;d have a bug:</p><blockquote><p><code>if (strpos($haystack, $needle)) {</code></p></blockquote><p>The assumption is that the condition will be true if the needle is found in the haystack, but as written, the condition will only be true if the needle is found in the haystack <em>but not as the first thing in the haystack</em>. The proper way to write that conditional is:</p><blockquote><p><code>if (strpos($haystack, $needle) !== false) {</code></p></blockquote><p>Also note that it&#8217;s an identity comparison to false, because using != contains the same bug, as 0 does equal false.</p><p>Thanks to Matti for the good question. I hope this has clarified the issue and please, anyone, let me know if you have more questions or comments about this or similar matters.</p><h2 id="news">Larry Ullman&#8217;s Book News =&gt; &#8220;PHP Advanced and Object-Oriented Programming&#8221;</h2><p>First, I continue to receive a lot of positive feedback on the &#8220;<a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/">Modern JavaScript: Develop and Design</a>&#8221; book, which makes me very happy. I&#8217;ve posted a couple of the comments <a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/reviews/">on my Web site</a>, and currently the book has received five reviews on <a
href="http://amzn.to/wsdmkq">Amazon</a>, all for five stars. The book seems to be selling well, too, which is great, but knowing that I was able to do what I set out to do—and that my intention actually did match up with what readers wanted—is paramount. My continued thanks to everyone for their interest in the book and for the nice words on it.</p><p>Right now, I&#8217;m continuing to chug away on the third edition of my PHP advanced book, titled &#8220;<a
href="http://amzn.to/M6yvzg">PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide</a>&#8220;. I&#8217;ve written four chapters thus far and hope to get another two written before I head off to Istanbul (in 10 days!).</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/05/21/what-is-larry-thinking-55-good-companies-books-answers/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <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>Interview with Douglas Crockford</title><link>http://www.larryullman.com/2012/05/11/interview-with-douglas-crockford/</link> <comments>http://www.larryullman.com/2012/05/11/interview-with-douglas-crockford/#comments</comments> <pubDate>Fri, 11 May 2012 11:00:21 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[crockford]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3193</guid> <description><![CDATA[SmashingMagazine recently published an interview with Douglas Crockford. Crockford, in case you&#8217;re not familiar, is one of the key proponents of JavaScript. One of JavaScript&#8217;s &#8220;founding fathers&#8221;, if you will. His Master Class video series on JavaScript and the history of programming is really quite illuminating. The interview is part of a new SmashingMagazine series called &#8220;How I Work&#8221;. [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://smashingmagazine.com">SmashingMagazine</a> recently <a
href="http://coding.smashingmagazine.com/2012/04/27/yahoos-doug-crockford-on-javascript/">published an interview</a> with <a
href="http://www.crockford.com">Douglas Crockford</a>. Crockford, in case you&#8217;re not familiar, is one of the key proponents of JavaScript. One of JavaScript&#8217;s &#8220;founding fathers&#8221;, if you will. His <a
href="http://my.safaribooksonline.com/video/programming/javascript/9781449379759">Master Class video series</a> on JavaScript and the history of programming is really quite illuminating.</p><p>The interview is part of a new SmashingMagazine series called &#8220;How I Work&#8221;. As they describe it:</p><blockquote><p>These interviews revolve around how thinkers and creators in the Web world design, code, and create. The goal is not to get into the specific nuances of their craft (as that information already exists online), but rather step back and learn a bit about their habits, philosophies, and workflow for producing great work.</p></blockquote><p>For that reason, the interview is useful whether or not you do any JavaScript programming, as Crockford has great insights into programming in general. Just two things that caught my attention&#8230;</p><blockquote><p><strong>WHAT WERE THE TRAITS OF THE WEAK PROGRAMMERS YOU’VE SEEN OVER YOUR CAREER?</strong><br
/> That’s an easy one—lack of curiosity. They were so satisfied with the work that they were doing was good enough (without an understanding of what ‘good’ was) that they didn’t push themselves.</p></blockquote><p>and &#8230;</p><blockquote><p><strong>HOW MUCH OF A LANGUAGE DO YOU NEED TO KNOW?</strong><br
/> Virtually every programming language is too big. Language standards have difficulty removing unnecessary features but as users we can choose not to use it.<br
/> I would say you can do 100% with knowing 50% of the language.</p></blockquote><p>As for the first, the greatest thing about working for myself is the ability to learn whatever I want. I&#8217;m not pigeonholed into one subject or career. I can see what interests me and expand my knowledge as I see fit. (On the other hand, I&#8217;d certainly make more money if I specialized but there&#8217;s more to life than making money, they say.)</p><p>As for the second, that&#8217;s an interesting suggestion, and one I&#8217;ve not heard before. To be fair, when I write a book on a language, I have to make decisions about what to discuss and what not to (e.g., never cover goto!), but I wouldn&#8217;t have put that number at 50% or in that area. Still, it&#8217;s great that an expert on a language admits that much of it isn&#8217;t necessary, at least not most of the time.</p><p>After the interview, which isn&#8217;t too long, there are two video clips worth checking out. Both are around an hour long, but will give you a sense of what Crockford does in his Master Class videos. One of those videos, and many more, can be found in Yahoo!&#8217;s excellent <a
href="http://yuilibrary.com/theater/">YUI Theater</a>.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/05/11/interview-with-douglas-crockford/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>What&#8217;s New in PHP 5.4</title><link>http://www.larryullman.com/2012/05/09/whats-new-in-php-5-4/</link> <comments>http://www.larryullman.com/2012/05/09/whats-new-in-php-5-4/#comments</comments> <pubDate>Wed, 09 May 2012 11:00:21 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3130</guid> <description><![CDATA[So PHP 5.4 came out a little while back, and although there aren&#8217;t any major changes, there are a couple to be aware of. Most of the changes involve either very advanced PHP programming (e.g., closures now support the $this variable) or somewhat advanced Object-Oriented Programming. But there are a some changes that will affect the [...]]]></description> <content:encoded><![CDATA[<p>So PHP 5.4 came out a little while back, and although there aren&#8217;t any major changes, there are a <a
href="http://docs.php.net/manual/en/migration54.new-features.php  " class="broken_link">couple to be aware of</a>. Most of the changes involve either very advanced PHP programming (e.g., closures now support the <strong>$this</strong> variable) or somewhat advanced Object-Oriented Programming. But there are a some changes that will affect the average PHP programmer, which I&#8217;ll outline here.<span
id="more-3130"></span></p><h2>Short Array Syntax</h2><p>Historically in PHP, on used the <strong>array()</strong> function to create a new array, as in:</p><pre class="brush: php; title: ; notranslate">$empty = array();
$numbers = array(1, 2, 3, 4);
$states = array('AL' =&gt; 'Alabama', 'AK' =&gt; 'Alaska', 'AZ' =&gt; 'Arizona');</pre><p>PHP 5.4 now has the short array syntax, which just replaces calls to <strong>array()</strong> with the array operator:</p><pre class="brush: php; title: ; notranslate">$empty = [];
$numbers = [1, 2, 3, 4];
$states = ['AL' =&gt; 'Alabama', 'AK' =&gt; 'Alaska', 'AZ' =&gt; 'Arizona'];</pre><p>This is all good and fine, and matches what you might be doing in other languages (such as JavaScript), but remember that you can only do this as of PHP 5.4. This means that unless you know that any server you&#8217;ll be using your code on, now or in the future, must be running PHP 5.4 or later.</p><h2>&lt;?= Always Available</h2><p>In previous versions of PHP, if the short open tags setting was enabled, you could do this shortcut to print the value of a variable:</p><pre class="brush: php; title: ; notranslate">&lt;?=$some_var; ?&gt;</pre><p>Most commonly you&#8217;ll see this when using frameworks and templating tools. As of PHP 5.4, this is now always an option, even if short tags are disabled. The only thing to be careful of with this syntax is that it assumes that <strong>$some_var</strong> has a value.</p><h2>Built-in Web Server</h2><p>In my opinion, the coolest addition is the built-in <a
href="http://docs.php.net/manual/en/features.commandline.webserver.php" class="broken_link">web server in CLI mode</a>. In fact, I&#8217;ve already written about it in Chapter 12 of the third edition of my &#8220;<a
href="http://www.larryullman.com/2012/04/09/php-5-advanced-visual-quickpro-guide-3rd-edition-table-of-contents/">PHP Advanced: Visual QuickPro Guide</a>&#8220;, which I&#8217;m currently writing. PHP&#8217;s command-line interface (CLI) mode allows you to run PHP commands and PHP scripts from the command-line interface. As of PHP 5.4, that command-line tool also has a basic Web server that can be enabled, letting you test PHP scripts in a Web browser without using Apache or IIS or another Web server application. In short, it just became a bit easier to quickly test some PHP code.</p><h2>The session_status() Function</h2><p>PHP 5.4 introduces some new functions, constants, classes, and methods, but the one that most piques my interest is <strong>session_status()</strong>. This function returns a constant indicating the current session status:</p><ul><li><strong>PHP_SESSION_DISABLED</strong> if sessions are disabled.</li><li><strong>PHP_SESSION_NONE</strong> if sessions are enabled, but none exists.</li><li><strong>PHP_SESSION_ACTIVE</strong> if sessions are enabled, and one exists.</li></ul><p>I haven&#8217;t played with this yet myself, but imagine it could be a useful debugging tool, at the very least.</p><h2>Removed Features</h2><p>Finally, you should be aware that PHP 5.4 has removed several features that have been deprecated for some time. Off these, three are important (in that they used to be important):</p><ul><li>Safe mode is no longer supported</li><li>Magic Quotes does not exist (and the <strong>get_magic_quotes_gpc()</strong> function always returns false)</li><li>The <strong>register_globals</strong> directive has been removed</li></ul><p>With these three changes, you can officially no longer use features that you hopefully stopped using a long, long time ago.</p><p>So there you have the key changes in PHP 5.4, aside from some of the more esoteric things. The changes here aren&#8217;t nearly on the same scale as those introduced in PHP 5.1 (e.g. <a
href="http://docs.php.net/pdo" class="broken_link">PDO</a> extension enabled), 5.2 (e.g., <a
href="http://docs.php.net/manual/en/ref.filter.php" class="broken_link">Filter</a> and <a
href="http://docs.php.net/manual/en/ref.json.php" class="broken_link">JSON</a> extensions enabled), and 5.3 (e.g., <a
href="http://docs.php.net/manual/en/language.namespaces.php" class="broken_link">namespaces</a> and <a
href="http://docs.php.net/manual/en/functions.anonymous.php" class="broken_link">closures</a>, the <a
href="http://docs.php.net/manual/en/book.fileinfo.php" class="broken_link">Fileinfo</a> extension, the <a
href="http://docs.php.net/manual/en/book.intl.php" class="broken_link">INTL</a> extension), but it&#8217;s good that a language that&#8217;s been around for so long continues to get tweaked, even in minor ways. Makes you wonder what&#8217;s left for PHP 5.5, let alone 6, though?</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/05/09/whats-new-in-php-5-4/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Review of &#8220;Technical Blogging&#8221; by Antonio Cangiano</title><link>http://www.larryullman.com/2012/05/07/review-of-technical-blogging-by-antonio-cangiano/</link> <comments>http://www.larryullman.com/2012/05/07/review-of-technical-blogging-by-antonio-cangiano/#comments</comments> <pubDate>Mon, 07 May 2012 11:00:44 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[blog]]></category> <category><![CDATA[book]]></category> <category><![CDATA[reading]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3166</guid> <description><![CDATA[As part of my  (which really turned out to be February-March), I&#8217;ve been going through a stack of books, and a virtual stack of ebooks, that I&#8217;ve had lying around for way too long. One of the first books from that stack that I read was &#8220;Technical Blogging&#8220;, by Antonio Cangiano. I bought the ebook [...]]]></description> <content:encoded><![CDATA[<p>As part of my <a
href="http://www.larryullman.com/2012/01/03/my-january-2012-non-resolutions-list/">January-February 2012 downtime</a> (which really turned out to be February-March), I&#8217;ve been going through a stack of books, and a virtual stack of ebooks, that I&#8217;ve had lying around for way too long. One of the first books from that stack that I read was &#8220;<a
href="http://amzn.to/H6gFcE">Technical Blogging</a>&#8220;, by <a
href="http://antoniocangiano.com/">Antonio Cangiano</a>. I bought the ebook through <a
href="http://pragprog.com/">Pragmatic Programmer</a>&#8216;s Black Friday sale back in November, and it&#8217;s available through Pragmatic Programmer, or Amazon, of course. Overall, I was quite impressed with the book, and I think it&#8217;s going to help me a lot. Before I discuss the book in detail, a quick bit of perspective&#8230;<span
id="more-3166"></span></p><p>I started blogging relatively recently, about two or three years ago, I think. In retrospect, I&#8217;m not sure why I started blogging, as I had no game plan and no intent of making money from the blog. I suspect the impetus was supporting <a
href="http://www.larryullman.com/books/">my books</a>, but that&#8217;s probably as much as I thought about it. Eventually I added a single Amazon widget to my site, again as a way to promote my books. In part because of the success of my <a
href="http://www.larryullman.com/series/learning-the-yii-framework/">Learning the Yii Framework</a> series, I was surprised when I started getting decent traffic to my site, and making a bit of money through the Amazon widget. To be completely transparent about the money, I make around a few hundred dollars per year with the site set up as is. I&#8217;m not quitting my day job on that, but it is enough to pay for my hosting costs, as well as my <a
href="http://www.larryullman.com/newsletter/">monthly newsletter</a>, and my<a
href="http://www.larryullman.com/forums/"> forum</a> software. After seeing a mist of potential in this area, and with 2012 being the year of legitimizing much of my business, I read &#8220;Technical Blogging.&#8221;</p><p>Like any well written book, it&#8217;s well organized, broken down into five sequential parts:</p><ul><li>Part I — Plan It</li><li>Part II — Build It</li><li>Part III — Promote It</li><li>Part IV — Benefit from It</li><li>Part V — Scale It</li></ul><p>In my own situation, I had already done parts two and four on my own blog, without ever giving much thought to parts one and three. Clearly, it&#8217;s hard to know if your site is succeeding when you&#8217;ve established no goals for it! And while my primary goal is to sell more books, after reading just the first part, I was able to come up with other, more immediate and tangible goals.</p><p>The book&#8217;s structure is sound, but the strength of the book is this: <strong>lots of concrete, specific advice</strong>. The book has decent breadth in the topics it covers, but always provides exact recommendations. For example, in the <em>Build It</em> chapter, Mr. Cangiano talks about the software and hosting options, from using <a
href="http://wordpress.org">WordPress</a> to more geeky options like <a
href="http://jekyllbootstrap.com/">Jekyll</a>. After covering the range of options, you get specific advice:</p><blockquote><p>&#8220;Opt for a self-hosted WordPress installation if you are the kind of person who doesn’t mind dealing with a remote Linux box.&#8221;</p></blockquote><p>and</p><blockquote><p>&#8220;If you don’t have an IT background or would like to test the waters before committing to something&#8230; I recommend Blogger (from Google) due to&#8230;&#8221;</p></blockquote><p>This approach—presenting the options, with pros and cons, and then making recommendations—continues throughout the book, even when it comes to the money and statistics. Mr. Cangiano explicitly talks about the hits his sites get and is bravely honest about the income, too. He discusses, for example, the effectiveness of various social media sites, and how much he earns from ads vs. Amazon referrals vs. sponsorships. Providing the details, regardless of their personal nature, makes it really easy for the reader to make his or her own decisions. For example, I don&#8217;t have any ads on my site now (a la <a
href="http://www.google.com/adsense">AdSense</a>), which is very much my preference. But I was worried that I was missing out on good money because of this value of mine. Mr. Cangiano, in a table citing his monthly income for a given month, shows that AdSense accounted for only 3% of the total. Knowing that, Mr. Cangiano has saved me from going through all the hassle of integrating AdSense, bothering viewers with random ads, only to make a smidgen of money.</p><p>The area in which I learned the most is promoting the blog via social media and other avenues, such as <a
href="http://www.reddit.com">Reddit</a>. All marketing stuff is foreign to me, and I&#8217;m just finally getting involved with social media. In fact, I&#8217;m in the process of creating a new theme for my site, which will more prominently feature my social media connections (and, more importantly, give more space to the content itself). Over the summer I&#8217;ll work harder to implement the social media tools, and I&#8217;ve set some goals for where I&#8217;d like to be in a year from now.</p><p>All in all, I have literally seven pages of notes that I took while reading the book. And while I&#8217;ve only begun using this new-found knowledge, I have no doubt that what I learned from &#8220;<a
href="http://amzn.to/H6gFcE">Technical Blogging</a>&#8221; will pay off. If you do technical blogging as well, I would highly recommend it!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/05/07/review-of-technical-blogging-by-antonio-cangiano/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>What Is Larry Thinking? #54 =&gt; Salt, Pepper, 99designs, and Ajax</title><link>http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/</link> <comments>http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#comments</comments> <pubDate>Mon, 30 Apr 2012 11:00:06 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[99designs]]></category> <category><![CDATA[ajax]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[phpvqp3]]></category> <category><![CDATA[security]]></category> <category><![CDATA[travel]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3190</guid> <description><![CDATA[In this edition… About This Newsletter On the Web? =&#62; Properly Salting Passwords, The Case Against Pepper On the Road =&#62; Istanbul and Silicon Valley On the Blog =&#62; My New Logo and Business Card from 99designs On the Blog =&#62; Five Ways to Lose Work On the Blog =&#62; Yii and Me (aka, the [...]]]></description> <content:encoded><![CDATA[<p> In this edition…</p><ul><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#about">About This Newsletter</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#web">On the Web? =&gt; Properly Salting Passwords, The Case Against Pepper</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#road">On the Road =&gt; Istanbul and Silicon Valley</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#blog1">On the Blog =&gt; My New Logo and Business Card from 99designs</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#blog2">On the Blog =&gt; Five Ways to Lose Work</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#blog3">On the Blog =&gt; Yii and Me (aka, the Yii Book)</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#qa1">Q&amp;A =&gt; How Do I Make Ajax Content Available to Search Engines</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#qa2">Q&amp;A =&gt; Can You Use .html Instead of .php?</a></li><li><a
href="http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/#news">Larry Ullman&#8217;s Book News => &#8220;PHP 5 Advanced: Visual QuickPro Guide&#8221; (3rd Edition)</a></li></ul><p> <span
id="more-3190"></span></p><h2 id="about">About This Newsletter</h2><p>To repeat what I&#8217;ve said in the past two newsletters, I am now officially on <a
href="http://twitter.com">Twitter</a>. Hopefully next month, I&#8217;ll get the Twitter &#8220;follow me&#8221; link on my main site and add it to this newsletter template. But in the meantime, you can follow me using <a
href="https://twitter.com/#!/LarryUllman">@LarryUllman</a>. I&#8217;m doing better about sending out tweets, and I do retweet things that I think are notable or useful. In fact, I sent out a tweet a couple of days ago asking for good newsletter questions, and I received a few, one of which I answer here. Even an old dog can learn a new trick, I guess.</p><p>Also, I would love to have more questions to answer in forthcoming newsletters. I tend to get the most questions when I do a book giveaway, and I haven&#8217;t had one of those in a while, so the well is running a bit dry.</p><p>As always, questions, comments, and all feedback are much appreciated. And thanks for your interest in what I have to say and do!</p><h2 id="web">On the Web => Properly Salting Passwords, The Case Against Pepper</h2><p>Anthony Ferrara, creator of the PHP <a
href="https://github.com/ircmaxell/PHP-PasswordLib">PasswordLib</a> library,&nbsp;just recently <a
href="http://blog.ircmaxell.com/2012/04/properly-salting-passwords-case-against.html">posted a discussion of using salts and pepper</a> to improve the security of a stored password. Mostly, the article is a discussion of why a pepper is unnecessary (and if you don&#8217;t know what a &#8220;pepper&#8221; is, just read the article), but the posting also does a good job of explaining the purpose of a salt, and why the salt does not need to be a secret. The posting is relatively short, and is something I think everyone can benefit from reading.</p><p>The posting ends with the most important security fact:</p><blockquote><p>Remember, the most dangerous kind of security is a false sense of it. Thinking you&#8217;ve made your application more secure, when in fact you&#8217;ve weakened it, is the worst thing you could possibly do.</p></blockquote><h2 id="road">On the Road => Istanbul and Silicon Valley</h2><p>For the first time in a long time, I&#8217;m going to do some work-related traveling. I used to travel somewhat regularly for conferences and training seminars and the like. But then I had kids and other personal issues came up, so I cut back. I <em>think</em> the last time I travelled for work was when I spoke at a Voices That Matter conference in Nashville, TN in 2008!</p><p>My first trip is to Istanbul, Turkey, at the end of May. I&#8217;ll be speaking at the <a
href="http://e-commerceexpo.com/">E-commerce Expo</a> on May 30th (the site is in Turkish, so you&#8217;ll want to use a browser like Chrome that will translate the page for you). I will have about two other days to see what I can of the city, so if anyone has any recommendations of what to see and do, or where to eat, please let me know. I&#8217;ve heard nothing but great things about Istanbul and am really looking forward to it. Oh, and my speech—<strong>Building a Successful E-commerce Venture, or Failing Gracefully</strong>—should be good, too.</p><p>At the end of June, I&#8217;ll be doing two days of training on JavaScript and jQuery at the Mid-Pacific ICT Center Summer 2012 Faculty Development Week in Fremont, California. I&#8217;m tentatively thinking about making myself available for drinks or dinner on Thursday, June 28th, although I haven&#8217;t thought it through, yet. If you&#8217;re in the area and think you&#8217;d like to meet, let me know and I&#8217;ll see what makes sense from there. Thanks!</p><h2 id="blog1">On the Blog => My New Logo and Business Card from 99designs</h2><p>In March, I finally got around to having a new logo and business card created, using <a
href="http://99designs.com">99designs</a>. It wasn&#8217;t a driving need for me, but it was about time. I wrote about <a
href="http://www.larryullman.com/2012/04/18/my-99designs-logo-and-business-card-contest/">the contest experience</a> in one blog post. In another blog post, I show <a
href="http://www.larryullman.com/2012/04/16/my-new-logo-and-business-card/">the end results</a>, and also some of the terrible logos and business cards I&#8217;ve had along the way (i.e., the ones I designed).</p><p>I&#8217;ve since hired a designer to modify my CSS to use the new logo and colors. This is going to go with a new WordPress theme, which I&#8217;m hoping to get online in May. Hoping. After that I&#8217;ll also update this newsletter template.</p><h2 id="blog2">On the Blog => Five Ways to Lose Work</h2><p>In <a
href="http://www.larryullman.com/2012/04/02/what-is-larry-thinking-53-writing-and-working/#thinking">the previous newsletter</a>, I wrote about competing for work. Getting work is a frequent topic of conversation I have with readers, and between that question, and my recent experiences with 99designs, I wrote a blog post titled &#8220;<a
href="http://www.larryullman.com/2012/04/11/five-ways-to-lose-work/">Five Ways to Lose Work</a>&#8221;. Although some of the examples in that post come from my 99designs experience, it&#8217;s not really about 99designs, but more about the common mistakes people make when trying to get a project. My intent is that by recognizing these mistakes, you&#8217;ll be less likely to make them, and therefore have a better chance of getting work.</p><h2 id="blog3">On the Blog => Yii and Me (aka, the Yii Book)</h2><p>Many people have appreciated my <a
href="http://www.larryullman.com/series/learning-the-yii-framework/">Learning the Yii Framework</a> series and are awaiting a formal Yii book written by me. This is something I have been hoping to do for sometime. It looks like that time will be the latter half of 2012. Almost definitely. In <a
href="http://www.larryullman.com/2012/04/23/yii-and-me-aka-the-yii-book/">a recent blog post</a>, I announced my current plans and thinking about the book. I was also very pleased to say that Qiang Xue, the creator of Yii, has generously agreed to act as the technical editor for the book. Now it&#8217;s just a matter of writing it!</p><h2 id="qa1">Q&amp;A => How Do I Make Ajax Content Available to Search Engines?</h2><p>I&#8217;m digging way through the archives to find questions to answer, and I came across this one sent in by Richard back in October of 2008. It&#8217;s probably way too late to help Richard, but perhaps my answer can be of use to others. Here&#8217;s the prompt (summarized by me):</p><blockquote><p>I have a discussion board that pulls posts via Ajax, which means that posts aren&#8217;t being indexed by search engines. I updated the system so that all posts are displayed by PHP, to make them search engine visible, and then use Ajax for new posts since the user got online, but are there other places where Ajax presents this sort of problem?</p></blockquote><p>This brings up a very good point that every Web developer ought to be aware of. It&#8217;s obvious that if someone disables JavaScript, they can&#8217;t see the JavaScript functionality on a site. Statistically, only around 1-3% of all <em>users</em> have JavaScript disabled. However, <en>all search engine bots</en> are unable to see JavaScript-derived content. This means that all content on your site that&#8217;s created by JavaScript will not appear in search engines. This is especially ironic as many sites use JavaScript for the most important content. So what&#8217;s the solution?</p><p>The solution is actually the same solution for all JavaScript-based sites. Unless the site absolutely has to require JavaScript, you should always start with a non-JavaScript version first. A non-JavaScript version will be accessible by all search engines and by, well, anyone. The non-JavaScript version may not be pretty or cool, but it will be functional, which is most important. Then you can add the JavaScript layer to implement the cool, or more interactive, version. This process is called &#8220;progressive enhancement&#8221; and is a cornerstone of modern JavaScript, as explained in my &#8220;<a
href="http://www.larryullman.com/books/modern-javascript-develop-and-design/">Modern JavaScript: Develop and Design</a>&#8221; book.</p><p>If, for whatever reason, you don&#8217;t want to take this approach, then simply create alternative versions of your content that would be available for search engines. This could be as simple as a site map that links to non-dynamic versions of the content.</p><h2 id="qa2">Q&amp;A => Can You Use .html Instead of .php?</h2><p>This question came in from @enxaneta_info via Twitter:</p><blockquote><p>Is it possible to replace the <strong>.php</strong> extension with <strong>.html</strong>?</p></blockquote><p>The short answer is yes. A file&#8217;s extension just tells the computer what application should be used to execute that file. With Web files, the extension tells the Web server how to treat that file. Normally, the <strong>.php</strong> extension indicates that the code therein should be run through the PHP module. If you wanted to use <strong>.html</strong>, you&#8217;d just need to tell the Web server to send all files with a <strong>.html</strong> extension through the PHP module. (This is done via an AddType directive in the Apache configuration file.)</p><p>One benefit of doing this is that it allows you to hide what type of server-side tool is being used. On the other hand, there is certain to be a performance hit as the Web server will send every page through the PHP module. But if you have a site that only contains PHP scripts and has no HTML files, this is a reasonable change to make.</p><h2 id="news">Larry Ullman&#8217;s Book News => &#8220;PHP 5 Advanced: Visual QuickPro Guide&#8221; (3rd Edition)</h2><p>I&#8217;ve formally started writing the third edition of my &#8220;<a
href="http://www.larryullman.com/books/php-5-advanced-visual-quickpro-guide-2nd-edition/">PHP 5 Advanced: Visual QuickPro Guide</a>&#8221; book. You can view the initial <a
href="http://www.larryullman.com/2012/04/09/php-5-advanced-visual-quickpro-guide-3rd-edition-table-of-contents/">Table of Contents</a> on my Web site, along with some discussion of my approach to this edition. The new edition is tentatively titled &#8220;Advanced PHP and Object-Oriented Programming: Visual QuickPro Guide&#8221;, to better reflect the book&#8217;s focus.</p><p>If you have any thoughts on the book&#8217;s table of contents, please share them on that blog posting page. As I said, I&#8217;m writing the book now, and it will be my primary focus for the next two months. Ideally the first submitted draft will be completed by the end of May (although that will be a stretch), and the book will come out by the end of summer.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/04/30/what-is-larry-thinking-54-salt-pepper-99designs/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Yii and Me (aka, the Yii Book)</title><link>http://www.larryullman.com/2012/04/23/yii-and-me-aka-the-yii-book/</link> <comments>http://www.larryullman.com/2012/04/23/yii-and-me-aka-the-yii-book/#comments</comments> <pubDate>Mon, 23 Apr 2012 11:18:49 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[book]]></category> <category><![CDATA[yii]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3187</guid> <description><![CDATA[Thanks largely to the success of my Learning the Yii Framework series, people are often asking me about my plans to write a book on Yii. Writing a book on Yii is something that I&#8217;ve been meaning to do for some time, but have been way too busy for the past couple of years to [...]]]></description> <content:encoded><![CDATA[<p>Thanks largely to the success of my <a
href="http://www.larryullman.com/series/learning-the-yii-framework/">Learning the Yii Framework</a> series, people are often asking me about my plans to write a book on <a
href="http://www.yiiframework.com">Yii</a>. Writing a book on Yii is something that I&#8217;ve been meaning to do for some time, but have been way too busy for the past couple of years to make it happen. Every so often I post something about the phantom Yii book, and so here&#8217;s another. This time, it&#8217;s pretty good news&#8230;</p><p>As for my schedule, I&#8217;m now writing the third edition of my &#8220;<a
href="http://www.larryullman.com/2012/04/09/php-5-advanced-visual-quickpro-guide-3rd-edition-table-of-contents/">PHP 5 Advanced: Visual QuickPro Guide</a>&#8221; book. That project will take the next couple of months, through June. I&#8217;m hoping it will be entirely done (rewrites and all) in early July. I think I&#8217;ll have a decent-sized Web project to do in the fall, but other than that, I have no deadlines and obligations for the latter half of 2012. Little things will no doubt come along, but this kind of free time is unusual for me. (And, strangely, isn&#8217;t frightening at the moment, although free time come January could be a problem!) So, reasonably speaking, I will be able to work on the Yii book full time as of August 2012. This should coincide nicely with the hopeful release of Yii 2.0 over the summer. Speaking of which&#8230;</p><p>I&#8217;ve been chatting with Qiang Xue, the creator of Yii, and he has graciously offered to act as the personal tech editor for the book. This is a great honor to me, and will be a wonderful asset in making sure the book is as technically accurate as possible. In return, I&#8217;m going to help with some of the official Yii documentation (it&#8217;s the least I can do). And the good news keeps rolling in, as <a
href="http://rmcreative.ru/">Alex Makarov</a>, author of the popular <a
href="http://yiicookbook.org/">Yii 1.1 Application Development Cookbook</a> (Packt Publishing), has generously offered his assistance, too. These are invaluable pieces that are coming together nicely here.</p><p>In terms of publishing, my current plan is&#8230;</p><ul><li>To self-publish an ebook only. I will release it in mobi, epub, and PDF formats, without any annoying Digital Rights Management (DRM).</li><li>Possibly no DRM.</li><li>Probably no DRM.</li><li>The price would be about $15 (USD).</li><li>People would be able to buy the book in advance, and get each chapter as I write it. Revised chapters would be free updates.</li><li>People would be able to buy just a single chapter and get revisions of that chapter as free updates.</li></ul><p>I&#8217;m assuming that I&#8217;ll create a separate Web site for the book, as I&#8217;m also planning on making some of the book&#8217;s content freely available in HTML format. This does mean that along with writing the book, I&#8217;ll have to create the Web site and the above functionality, but such are the costs of doing things yourself. And I happen to know of a framework that makes Web development a lot faster&#8230;</p><p>I&#8217;ll continue posting updates here and on <a
href="http://www.twitter.com">Twitter</a> (by the way, I&#8217;m on Twitter <a
href="https://twitter.com/#!/LarryUllman">@LarryUllman</a>) as I have them. Yii postings may be sporadic for the next couple of months as I focus on the PHP Advanced book, but rest assured the Yii book is happening.</p><p>All thoughts, feedback, input, and offers of money are most welcome!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/04/23/yii-and-me-aka-the-yii-book/feed/</wfw:commentRss> <slash:comments>40</slash:comments> </item> <item><title>My 99designs Logo and Business Card Contest</title><link>http://www.larryullman.com/2012/04/18/my-99designs-logo-and-business-card-contest/</link> <comments>http://www.larryullman.com/2012/04/18/my-99designs-logo-and-business-card-contest/#comments</comments> <pubDate>Wed, 18 Apr 2012 11:13:52 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[99designs]]></category> <category><![CDATA[outsource]]></category> <category><![CDATA[outsourcing]]></category> <category><![CDATA[work]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3155</guid> <description><![CDATA[As I wrote in a , I recently ran a 99designs contest to get a new logo and business card (see that post for the final results). In this post, I want to talk about the experience in more detail, although I should add that I decided (for some unknown reason) to make my contest private, [...]]]></description> <content:encoded><![CDATA[<p>As I wrote in a <a
href="http://www.larryullman.com/2012/04/16/my-new-logo-and-business-card/">post just published</a>, I recently ran a <a
href="http://www.99designs.com">99designs</a> contest to get a new logo and business card (see that post for the final results). In this post, I want to talk about the experience in more detail, although I should add that I decided (for some unknown reason) to make <a
href="http://99designs.com/logo-design/contests/logo-business-card-larry-ullman-126632" class="broken_link">my contest</a> private, so it cannot be viewed by anyone that is not a 99designs member (membership is free, if you really want to take a peek).</p><p><span
id="more-3155"></span></p><p>99designs, in case you&#8217;re not familiar with it, is perhaps the most popular of the &#8220;crowd sourcing&#8221; line of Web sites. There&#8217;s a good video on the home page that explains the concept, but I&#8217;ll give a quick overview, too. People who need design work done—logos, business cards, t-shirts, posters, brochures, Websites, icons, etc.—choose a category in which to start a contest. There are minimum prices, which vary by the project. For example, a Web site starts at $599 and a logo starts at $299. This is the minimum amount you can price your job at; you&#8217;re free to pay whatever price more than that. You then provide as many details as possible about what you&#8217;re looking for and begin the contest.</p><p>Once a contest is opened, designers can start uploading designs. This is a key benefit for the clients: you get to see the possible results. As the client, you&#8217;re not trying to hire a designer and hope s/he can do the work to your satisfaction, you&#8217;re buying the actual finished product. From the designer&#8217;s perspective, you get access to more jobs and clients than you otherwise would, and you&#8217;re guaranteed to be paid. (I&#8217;ll discuss the pros and cons and ethics of all this later in the post).</p><p>As designers are submitting work, you can provide feedback in a couple of ways. First, you can rank the work, which is a simple 1-5 stars. I didn&#8217;t really care for the terms assigned to these rankings, though, because one star meant &#8220;Has potential&#8221;, and there were clearly submissions that did not have potential (but I didn&#8217;t want to outright eliminate them either). You can also provide written feedback on a single design, to a specific designer, or provide notes to the public at large. For example, a designer might submit a handful of designs and I could say that I liked the font in this one, the colors in the other, etc. If several designers were submitting things that were off, I&#8217;d clarify the needs in a global message. Hopefully the designers will watch your feedback and customize their work accordingly. You can outright cut a design, which I did more aggressively towards the end, or outright cut a designer (which I think I only did twice).</p><p>At some point, the client can <em>guarantee</em> the job, which says that the overall quality is good enough for you to commit to paying someone. At another point (four days, in my case), you choose just the finalists (up to six). Over the following three days, in my case, you provide feedback to the finalists and can only receive more submissions from them. Once the contest is over, you can choose a winner. You indicate to the winner any final change requests, and what format you want the materials to be in. The designer does all that and uploads the final materials. You then sign off on it and the designer is paid. That&#8217;s the general formula, here&#8217;s how it played out for me&#8230;</p><p>I wanted both a logo and a business card. I thought I was going to create two separate contests, but it&#8217;s an option to tie them together, which is smart. So I created a logo and business card contest. I could have added in stationary or whatever, but I don&#8217;t have that need.</p><p>The minimum price is $299 for the logo, I believe, plus $99 or $149 for the business card (I forget). That put my minimum somewhere in the $400-$450 range. People that don&#8217;t like the concept of 99designs often focus on this idea of getting something of quality for relatively little money. Of course, experience would suggest, that almost never happens, regardless of the situation. What many people don&#8217;t know, or it just doesn&#8217;t get discussed as often, is that 99designs strongly encourages clients to spend more money. 99designs explains how you&#8217;ll get more and better submissions the more you&#8217;re willing to spend. They even have packages and enhancements to draw attention to your contest, much like <a
href="http://www.ebay.com">eBay</a>. In the end, my contest had a fixed price of $644 (USD), plus it cost me about $50 in fees that went to 99designs (much of that for running a private contest). Clearly, you could spend a lot more money for a business card and a logo, but I don&#8217;t feel that $644 is an unreasonably cheap price to pay. I could be wrong. What do you think?</p><p>As part of the contest particulars, you set the timeline. I had the contest run for a week, but I could have made it shorter (which I think means you have to spend more money). I also provided the requirements and suggestions for what I like. This was tough, because while I know what I like, I also like to be surprised. The downside to this public system is that once I started indicating that I liked a certain style, all of the designs started coming in along those lines. One designer near the end really came up with something different, and borderline brilliant, but there wasn&#8217;t time for that designer to really put something together that was entirely right.</p><p>Fairly quickly on the first day I started seeing designs, but they were generally poor. I would hasten to say that those designers with the greatest need and least experience were probably the ones to initially submit. And that makes sense. But there were several initial designs that I could have created, which isn&#8217;t good. This continued into the second day, with generally so-so designs. I think I eliminated one designer early on, as her work just wasn&#8217;t to my taste at all.</p><p>But by the third day, I reached a point where I had maybe 50 designs from about 15 designers, and I was seeing decent enough work to go ahead and guarantee the contest. I also read elsewhere that guaranteeing the contest is how you really get the best submissions, which turned out to be completely true. Within the next two days, I went from around 50 designs from 15 designers to 327 designs from 90 designers! It&#8217;s also at that point in time that the better quality submissions came in. I believe two of my finalists were there on day 2, with the other two coming in after that, including the winner.</p><p>Over the next two days, I continued providing feedback as the submissions came in. All told, I provided 222 comments! I was not prepared for that amount of work. And it was tough, because I often couldn&#8217;t provide suggestions for improvement, just comments along the lines of &#8220;Doesn&#8217;t quite work for me&#8221;. On the other hand, I would think designers would be used to that kind of feedback by now. Clients can be, um, difficult, no?</p><p>I was also surprised that designers would occasionally pull their submissions. Sometimes I think this was because the designer later thought twice about it. It was kind of annoying, though, as it would prevent me from seeing the progression of a designer&#8217;s work, which I found to be useful information. One designer outright pulled all of his designs. I suspect it&#8217;s because he knew he wasn&#8217;t going to make it to the finals, but it struck me as a tad unprofessional. There also seems to be a air of protecting one&#8217;s work as a reason to pull a submission. I don&#8217;t agree with that theory but&#8230;</p><p>After four days, I had to select the finalists. You can select up to six, I think, but I selected four. One designer created a single look which was my favorite. A second designer created a couple of looks that I really liked, but those didn&#8217;t resonate as well for the other people I got advice from. A third designer had two looks that were both good, but neither was as strong as the others. I included that designer in the finals because I liked the variety and thought he could put something interesting and different together. And the fourth designer was doing totally different things that really intrigued me (as already mentioned).</p><p>At this point I had less feedback to offer, which was particularly hard for Designer B, who was my initial favorite but eventually overtaken by Designer A. In short, all I had for Designer B was &#8220;I really like it, but I like Designer A&#8217;s thing better, and I don&#8217;t know what else to tell you.&#8221; On the other hand, if I could put design needs into words, perhaps I would actually have design skills!</p><p>During the final period, the designers also worked on the business card aspect of the contest (if they hadn&#8217;t already). A couple of designers even went ahead and mocked up the logo as a favicon/avatar and showed what the logo would look like as part of a Web site. Neither was an obligation of the job, but going that extra mile was a smart move. Plus it allowed me to see how a design would work in different formats, which was important in making the final decision. Doing more than you have to is always a good way to work!</p><p>With the contest over, it was time to make a decision. In the end, I had a total of 397 entries to consider! I ran a couple of polls on my favorite designs to get some more input, and I spoke with my wife about it a lot.</p><p>Once I chose the winner, I asked the designer to make a couple of minor changes (especially with the business card), and then indicated what actual files I&#8217;d need to receive. She provided those, we both signed off, and she got her $644. Again, you can <a
href="http://www.larryullman.com/2012/04/16/my-new-logo-and-business-card/">see the final choice here</a>.</p><p>I&#8217;ve since paid another designer I know some money to customize the CSS for my new template in order to adopt the logo and colors to it. I hope to put that online soon.</p><p>Overall, I&#8217;m very pleased with my experience. I was able to get a professional logo and business card at a price that I could afford. More than the price, though, I really benefited from seeing a lot of ideas. (I even came close to anointing two designers the winners, but that would have cost me twice as much and I knew I&#8217;d never use the second design.) But one of the reasons why I choose the finalists that I did was because they gave me the best range of designs, both among the group of them and individually (i.e., the winning designer had a great range in her portfolio). The whole experience was like visual brainstorming, and I imagine I&#8217;ll use 99designs again.</p><p>Now as for the ethics of it&#8230;</p><p>Before using 99designs, I had read some posts about it and saw some discussions of the ethics of such sites. Ethics are always personal, so I would never presume to suggest how anyone else should feel about these types of sites. However, I did think about it considerably, and decided that I didn&#8217;t have a problem with it. The main reason I feel it&#8217;s okay is this: both sides know exactly what the deal is going into it. The rules are clearly established, adhered to, and fair. Yes, it sucks for the 98 designers that put in some time but didn&#8217;t make any money, but that was their choice to participate. And even the winning designer, who seems to be quite good and has won 19 other contests, has also lost in 180 others.</p><p>Yes, sites like these could be described as taking advantage of people that badly need work, but the counter argument is that it gives people more avenues to get work. How else will a new designer living in an obscure part of whatever country find work and experience? And that&#8217;s another thing: experience. Those designers who didn&#8217;t win are able to get a lot of experience in terms of seeing what clients want, how to interact, and what professional quality work looks like. To me, that&#8217;s quite something. When I first started out, I would have been thrilled to have those kinds of opportunities. Where do you stand?</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/04/18/my-99designs-logo-and-business-card-contest/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>My New Logo and Business Card</title><link>http://www.larryullman.com/2012/04/16/my-new-logo-and-business-card/</link> <comments>http://www.larryullman.com/2012/04/16/my-new-logo-and-business-card/#comments</comments> <pubDate>Mon, 16 Apr 2012 14:48:26 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[99designs]]></category> <category><![CDATA[business card]]></category> <category><![CDATA[logo]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3176</guid> <description><![CDATA[For me, 2012 is a year focused on legitimizing much of my business. You might think that having written 22 books, worked for clients, performed training, and spoken at conferences, that my business would be well established. Well, you&#8217;d be right and wrong. I&#8217;m a one-man operation, so almost all of my energy and time [...]]]></description> <content:encoded><![CDATA[<p>For me, 2012 is a year focused on legitimizing much of my business. You might think that having written 22 books, worked for clients, performed training, and spoken at conferences, that my business would be well established. Well, you&#8217;d be right and wrong. I&#8217;m a one-man operation, so almost all of my energy and time is directed towards getting and doing work, with little to no time left for the secondary work-related things. The business side of things is going well enough, but I can no longer ignore these other issues. Towards that end, I finally decided that I&#8217;d pony up the money for a logo and business card. I received an estimate from a local (central Pennsylvania) company last year, that was around $6,000 (USD). Besides being well beyond what I could afford, it was also well beyond the value I place on having a logo and business card. A while back, I heard about <a
href="http://99designs.com/">99designs</a>, and decided to use that system instead. In a separate post, I&#8217;ll write about that process and experience, but here, I want to share the results.<img
title="More..." src="http://cloudfront.larryullman.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p><div><span
id="more-3176"></span></div><p>First, a little history&#8230; My in-laws created a consulting company about 16 years ago for my father-in-law&#8217;s work. I started working for them full-time in 1999, doing my own thing under the umbrella company, Com-Insights, short for Communication Insights. Here&#8217;s my first logo and business card, which I designed myself. Pretty impressive, no? Believe me when I say I have no design skills.</p><div><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/old_business_card.png"><img
class="aligncenter size-full wp-image-3177" title="My first business card" src="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/old_business_card.png" alt="My first business card" width="333" height="188" /></a></div><p>Years later, the company&#8217;s name was changed to DMC Insights, Inc., short for Digital Media and Communications Insights. This long name was supposed to represent the two sides of the business: what I did and what my father-in-law did. I hired a designer to create a new version of the Web site, and used a logo based upon that:</p><div><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/old_logo.png"><img
class="aligncenter size-full wp-image-3178" title="My Old Logo" src="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/old_logo.png" alt="My Old Logo" width="170" height="170" /></a></div><p>I also used that in a business card, which was somewhat better than the above. For years, I worked under DMC Insights, with that logo.</p><p>Eventually, my father-in-law retired and it was just me. I also realized that NO ONE cared about DMC Insights. Most of my work is related to my books, and people know &#8220;Larry Ullman&#8221;, not &#8220;DMC Insights&#8221;. At best. Many people don&#8217;t even remember a writer&#8217;s name, but no one remembered my company&#8217;s name. Fortunately, in 2010 I was able to purchase www.LarryUllman.com, allowing me to start doing all business just under my name.</p><p>With the new domain name, I created a new Web site, which is mostly a slightly modified WordPress theme. Using that theme&#8217;s colors, I came up with a new favicon/avatar:</p><div><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/avatar.png"><img
class="aligncenter size-full wp-image-3179" title="My old avatar" src="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/avatar.png" alt="My old avatar" width="48" height="48" /></a></div><p>Better than the work I&#8217;ve done in the past, sure, but not something to be proud of.</p><p>Here, then, is my new logo, created by a designer at 99designs (again, I&#8217;ll write more about that process later):</p><div><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/name_logo.png"><img
class="aligncenter size-full wp-image-3180" title="My New Logo" src="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/name_logo.png" alt="My New Logo" width="379" height="126" /></a></div><p>And you can see the new avatar and favicon in the address bar. Later this month I hope to update this site&#8217;s look using the new logo and colors. Here&#8217;s the business card that goes with it:</p><div><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/business_card_front.png"><img
class="alignnone size-full wp-image-3182" title="New Business Card Front" src="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/business_card_front.png" alt="New Business Card Front" width="167" height="250" /></a><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/business_card_back.png"><img
class="alignnone size-full wp-image-3181" title="New Business Card Back" src="http://cloudfront.larryullman.com/wp-content/uploads/2012/04/business_card_back.png" alt="New Business Card Back" width="167" height="249" /></a></div><p>It&#8217;s not amazing or revolutionary, but it&#8217;s nice and professional. And it&#8217;s not embarrassing, which is a HUGE step up from what I&#8217;ve had in the past. As I said, my logo and business card aren&#8217;t that important to me, but they shouldn&#8217;t be, um, pathetic, which is what my designs were. It&#8217;s almost always best to stick to what you know!</p><p>What do you think?</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/04/16/my-new-logo-and-business-card/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>&#8220;PHP 5 Advanced: Visual QuickPro Guide (3rd Edition&#8221; Table of Contents</title><link>http://www.larryullman.com/2012/04/09/php-5-advanced-visual-quickpro-guide-3rd-edition-table-of-contents/</link> <comments>http://www.larryullman.com/2012/04/09/php-5-advanced-visual-quickpro-guide-3rd-edition-table-of-contents/#comments</comments> <pubDate>Mon, 09 Apr 2012 11:01:26 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[oop]]></category> <category><![CDATA[phpvqp3]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3168</guid> <description><![CDATA[I&#8217;m just about to begin writing the third edition of my &#8220;&#8221;. This new edition is tentatively titled &#8220;Advanced PHP and Object-Oriented Programming: Visual QuickPro Guide&#8221;, which better reflects the book&#8217;s focus. The book is written for intermediate PHP and Web developers, and covers a range of topics to further extend what you know into more [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m just about to begin writing the third edition of my &#8220;<a
href="http://www.larryullman.com/books/php-5-advanced-visual-quickpro-guide-2nd-edition/">PHP 5 Advanced: Visual QuickPro Guide</a>&#8220;. This new edition is tentatively titled &#8220;Advanced PHP and Object-Oriented Programming: Visual QuickPro Guide&#8221;, which better reflects the book&#8217;s focus. The book is written for intermediate PHP and Web developers, and covers a range of topics to further extend what you know into more real-world, complex situations.<span
id="more-3168"></span></p><p>The previous edition had 14 chapters, plus two that were made available as free PDFs (one on image generation, the other on PDF generation). The current plan for this edition is to cut four chapters, add four entirely new chapters, and the add and remove some chapter sections here and there. The book will also have a &#8220;Review and Pursue&#8221; section at the end of each chapter, with review questions and pursue prompts.</p><p>My goals for this edition of the book were (in no particular order):</p><ul><li>Emphasize and expand the OOP sections</li><li>Add more content geared towards creating larger, more elaborate, professional Web applications</li><li>Add new content based upon changes in technologies since the last edition (specifically changes in PHP from version 5.2 to 5.4)</li><li>Update outdated content (including replacing old approaches with entirely new ones)</li><li>Removing no longer critical content</li><li>Removing content now discussed in other books of mine</li></ul><p>For example, new PHP features that will be covered include <a
href="http://php.net/manual/en/language.oop5.typehinting.php">type hinting</a>, the <a
href="http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc">Nowdoc</a> syntax, and <a
href="http://www.php.net/manual/en/language.oop5.traits.php">traits</a>. New Web application information include discussions of Apache&#8217;s mod_rewrite and <a
href="http://www.phpdoc.org/">phpDocumentor</a>, and a chapter on debugging tools, unit testing, and improving performance. The expanded OOP material includes a chapter on design patterns and a new chapter that creates a whole example using OOP.</p><p>With all that in mind, the initial Table of Contents is posted below. New content is in <span
style="color: #339966;">green</span>. Chapters I&#8217;ve cut (not reflected below) include one on security techniques (now well covered by my other books), another on e-commerce (I&#8217;ve since written a<a
href="http://www.larryullman.com/books/effortless-e-commerce-with-php-and-mysql/">whole book</a> on that), the PEAR chapter (replaced by one on the <a
href="http://framework.zend.com">Zend Framework</a>), and the Ajax chapter (well covered in many of my other books).</p><p>If you have any thoughts or suggestions, I&#8217;d love to hear them. Thanks!</p><ul><li>Chapter 1: Advanced PHP Techniques<ul><li>Multidimensional Arrays</li><li>Advanced Function Definitions</li><li><span
style="color: #339966;">Type Hinting</span></li><li><span
style="color: #339966;">Anonymous Functions</span></li><li>The Heredoc and <span
style="color: #339966;">Nowdoc</span> Syntax</li><li>Using printf() and sprintf()</li></ul></li><li>Chapter 2: Developing Web Applications<ul><li>Modularizing a Web Site</li><li><span
style="color: #339966;">Improved SEO with mod_rewrite</span></li><li>Affecting the Browser Cache</li><li><span
style="color: #339966;">Better Documentation with phpDocumentor</span></li></ul></li><li>Chapter 3: Advanced Database Concepts<ul><li>Storing Sessions in a Database</li><li>Working with U.S. Zip Codes</li><li>Creating Stored Functions</li><li>Displaying Results Horizontally</li><li><span
style="color: #339966;">Storing Binary Data</span></li><li><span
style="color: #339966;">Using PDO</span></li></ul></li><li><span
style="color: #339966;">Chapter 4: Debugging, Testing, and Performance</span><ul><li><span
style="color: #339966;">Debugging Tools</span></li><li><span
style="color: #339966;">Unit Testing</span></li><li><span
style="color: #339966;">Profiling Scripts</span></li><li><span
style="color: #339966;">Improving Performance</span></li><li><span
style="color: #339966;">Implementing Server Caches</span></li></ul></li><li>Chapter 5: Basic Object-Oriented Programming<ul><li>OOP Theory</li><li>Defining a Class</li><li>Creating an Object</li><li>The $this Attribute</li><li>Creating Constructors</li><li>Creating Destructors</li><li>Autoloading Classes</li></ul></li><li>Chapter 6: Advanced OOP<ul><li>Advanced Theories</li><li>Inheriting Classes</li><li>Inheriting Constructors and Destructors</li><li>Overriding Methods</li><li>Access Control</li><li>Using the Scope Resolution Operator</li><li>Creating Static Members</li><li>Abstract Classes and Methods</li><li><span
style="color: #339966;">Creating Namespaces</span></li><li><span
style="color: #339966;">Using Traits</span></li></ul></li><li><span
style="color: #339966;">Chapter 7: Design Patterns</span><ul><li><span
style="color: #339966;">What are Design Patterns?</span></li><li><span
style="color: #339966;">[[Discussion of Specific Patterns TBD]]</span></li></ul></li><li>Chapter 8: Real-World OOP<ul><li>Catching Exceptions</li><li>Extending the Exception Class</li><li><span
style="color: #339966;">Implementing MVC</span></li><li><span
style="color: #339966;">Using the Standard PHP Library</span></li><li><span
style="color: #339966;">OOP-based E-commerce</span></li></ul></li><li><span
style="color: #339966;">Chapter 9: Example&#8211;CMS with OOP</span></li><li>Chapter 10: Networking with PHP<ul><li>Accessing Other Web Sites</li><li>Working with Sockets</li><li>Performing IP Geolocation</li><li>Using cURL</li><li><span
style="color: #339966;">Creating Web Services</span></li></ul></li><li>Chapter 11: PHP and the Server<ul><li>Compressing Files</li><li>Establishing a cron</li><li>Scheduling Tasks on Windows</li><li><span
style="color: #339966;">Using PHP’s Built-In Server</span></li></ul></li><li>Chapter 12: PHP’s Command-Line Interface<ul><li>Testing Your Installation</li><li>Executing Bits of Code</li><li>Creating a Command-Line Script</li><li>Running a Command-Line Script</li><li>Working with Command-Line Arguments</li><li>Taking Input</li></ul></li><li>Chapter 13: XML and PHP<ul><li>What Is XML?</li><li>XML Syntax</li><li>Attributes, Empty Elements, and Entities</li><li>Document Type Definitions</li><li>Parsing XML</li><li>Creating an RSS Feed</li><li><span
style="color: #339966;">XML Error Handling</span></li></ul></li><li><span
style="color: #339966;">Chapter 14: Using the Zend Framework</span><ul><li><span
style="color: #339966;">Installation</span></li><li><span
style="color: #339966;">Creating and Validating Forms</span></li><li><span
style="color: #339966;">Adding Captcha</span></li><li><span
style="color: #339966;">Implementing Authentication</span></li><li><span
style="color: #339966;">Using Zend_Mail</span></li></ul></li></ul> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/04/09/php-5-advanced-visual-quickpro-guide-3rd-edition-table-of-contents/feed/</wfw:commentRss> <slash:comments>28</slash:comments> </item> </channel> </rss>
<!-- Served from: www.larryullman.com @ 2012-05-21 13:58:32 by W3 Total Cache -->
