SUBSCRIBE VIA RSS


Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.

Topics

TWITTER

Stack Overflow


The old fashioned way

  Uncategorized Articles

October 17, 2009 – 8:24pm The Secret Behind “SEO”

What is the secret to SEO?

“Make something great. Tell people about it. Do it again.”

from Spammers, Evildoers, and Opportunists by Derek Powazek:

The problem with SEO is that the good advice is obvious, the rest doesn’t work, and it’s poisoning the web. I’m going to tell you about the problems, and then tell you the one true way to generate traffic on the web, based on my own 14 years of hits and misses.

This is a great post, which I discovered through daringfireball. It’s worth a read, either if you manage a website and have wondered about what “SEO” can (or in this case, can’t) do for you, or if you are a web developer and you get clients asking how they can improve their search visibility.

Posted in  Uncategorized   |     |  1 Comment »   |  delicious  Digg

August 1, 2009 – 11:27pm On iphone revenue share business models

From the post:

Good app ideas are a dime a dozen. Your great idea isn’t guaranteed to make any money in the app store. Why should a developer develop your whole app for just a percentage of the money you are going to make? Just because you have a good idea? Most developers have good ideas too, and if they are going to risk not making anything for their hard work, they might as well balance that by doing their own work and making 100% of the profits.

More…

Posted in  Uncategorized   |     |  No Comments »   |  delicious  Digg

July 31, 2009 – 12:28pm Springloops deployment with svn externals

We’ve been trying out springloops as a hosted svn solution for one of our smaller projects, and so far it does the job just fine. We are using it to host the subversion repository for a symfony project. We generally like to use svn:externals for the symfony library files themselves, this way it its easy to upgrade symfony, make sure every deployment has the necessary code base without having to worry about having PEAR installed on every server. More…

Posted in  Uncategorized   |     |  4 Comments »   |  delicious  Digg

July 27, 2009 – 11:07am IE 6 getElementsById() and prototype $() function return dom elements by *name*

I can’t believe I had not run into this yet, but today I had a page that had an element (an anchor) with a name attribute (“floorplans”), and further down the page a div with that id (“floorplans”). When I tried to dynamically load content into my div using $(‘floorplans’), things were getting all out of control on IE 6. Turns out IE6’s document.getElementById returns the first element whose id OR name matches the string, and of course Prototype’s $() function relies on the browser’s own getElementById(). Lesson learned!

Posted in  Uncategorized   |     |  7 Comments »   |  delicious  Digg

July 21, 2009 – 5:06pm Propel criteria on custom columns (with addAsColumn)

This still trips me up. If you are using propel criteria objects and want to add a condition on a custom column, you have to do a bit of trickery to get it working just right. More…

Posted in  Uncategorized   |     |  1 Comment »   |  delicious  Digg

July 13, 2009 – 10:37am Symfony: returning an array from app.yml

Sometimes its useful to return an array of values from app.yml. This is buried in the symfony docs so I thought I’d post it here just in case it’d help.

I’ve been using this technique to store a list of languages available on a site. As translations are ready for other languages, I add them to the list here and they automatically get pulled into the code in the appropriate places:
More…

Posted in  Uncategorized   |     |  5 Comments »   |  delicious  Digg

July 11, 2009 – 2:52am php isset and not empty

I find myself doing this a lot:

if (isset($myarray['foo']) && $myarray['foo'])) {
  // do something
}

But I thought there had to be a better way, and one that would not throw undefined errors. A quick google search came up with a few good hits, include the PHP manual page for empty().

The manual says that when using empty(), no warnings are thrown when a variable is not set. It will return true in the following cases:

“” (an empty string)
0 (0 as an integer)
“0″ (0 as a string)
NULL
FALSE
array() (an empty array)
var $var; (a variable declared, but without a value in a class)

Keep in mind that an object with no properties is not considered empty().

Now, we can make our code a bit more beautiful:

if (!empty($myarray['foo'])) {
  // do something
}

I’ve known about empty() for a long time, but for some reason always seemed to choose isset() over empty(), even in cases like this.

Posted in  Uncategorized   |     |  3 Comments »   |  delicious  Digg

July 1, 2009 – 6:30pm Firebug and Firefox 3.5

I rely on Firebug daily to help me debug javascript and work with css. After upgrading to Firefox 3.5, I updated Firebug to the latest beta release, Firebug 1.4 Beta.

The beta version is of course rough around the edges, and one rough spot is the fact that often when editing css properties of an element on an html page, the entire style definition would simply disappear from the console.

Fortunately, as of today, the firebug-1.5X.0a07.xpi release fixes the problem. Click the link for 1.5X0a07.xpi within Firefox to update. I haven’t found any serious problems with the alpha version yet.

As a side note, if any of you are Safari users or are just testing your sites out for safari, make sure you enable the development menu (Preferences > Advanced > Enable Develop Menu) and then you can use the command-option-i to show a Firebug-like inspector. It’s growing on me each time I use it.

Posted in  Uncategorized   |     |  2 Comments »   |  delicious  Digg

March 14, 2009 – 2:46pm Symfony Propel Enum types

Propel does not support enum column types in its schemas, since the enum type is not support across all database types. There are a few ways around this. More…

Posted in  Uncategorized   |     |  4 Comments »   |  delicious  Digg

March 11, 2009 – 1:55am Symfony: How to render a partial from an action

If you ever find yourself wanting to return the contents of a partial as the entire response for an action, Symfony makes it possible. Using symfony partials with ajax, you have a lot of options of how you want to arrange your templates, but here I’ll show you what has worked best for me.

Oftentimes I find myself wanting to return the contents of a partial as the entire response for an ajax request. I do this a lot when I am already using a partial in my template, and then I want to replace that section with the results of an ajax call. We already have a partial set up to display that content, so we might as well reuse it when we have to refresh that area with new content. More…

Posted in  Uncategorized   |     |  6 Comments »   |  delicious  Digg