Archive for the ‘Web Development’ Category

TheWebLessons.com PHP Screencast Tutorials

Posted on August 5th, 2008 in CodeIgniter, PHP, Web Development | 1 Comment »



PHP Screencasts, PDF books, and source code. Lessons will be cover PHP Development, and the CodeIgniter PHP Framework.

As of today, TheWebLessons.com is open. If you register during the beta phase, you will receive a 50% discount on all of the lessons that will ever be published.

Lesson Topics Will Include

  • Object Oriented Programming in PHP5
  • Setting Up A CodeIgniter Project
  • Understanding MVC Architecture
  • Using Your Own Libraries With CodeIgniter
  • Working with Sessions
  • Databases and CodeIgniter
  • Working With Forms
  • Sending Email
  • Testing Your Code
  • And more…

Sign up today to lock in your discount.

My 2 Cents On Web Hosting

Posted on July 18th, 2008 in PHP, Ruby on Rails, Web Development | 3 Comments »

People regularly ask me where to host their websites. This is pretty much what I tell everybody.

RackSpace Is The Best

Unless You Don’t Want To Pay For Managed Hosting
Or You Want Ruby on Rails Support

An entry level server at RackSpace will cost you about $500/month. If you can afford a managed, dedicated server, and your are working with PHP host with RackSpace. I have several servers with RackSpace and have been working with them now for over 5 years. The service, support, and reliability are fantastic unless you intend to host Ruby on Rails applications. RackSpace does not “officially support” Rails. When you are talking to the sales department they say they will help with Rails issues even though it’s not officially supported. My experience is that you are totally on your own with Ruby on Rails at Rackspace.

RimuHosting Is The Best For Non-Managed Servers

The Best VPS, Semi-Dedicated and Dedicated Servers

So if you want to run Rails apps or you don’t need a managed dedicated server, host with RimuHosting. This blog is hosted at RimuHosting and for the past 2 years I have had both VPS accounts and Dedicated servers there. The uptime, performance and reliability has been extremely good although not quite flawless. There was one time when one of my semi-dedicated VPS accounts was unavailable for about an hour and it was not a scheduled maintenance period. Even with that one blip in the service, my overall experience has been excellent and I highly recommend RimuHosting if you want a VPS account or a non-managed dedicated server. The support is extremely fast and helpful – albeit via email only. I prefer email though, as long as it’s attended to promptly. In your customer control panel, you can see the status of your support ticket, how long it has been since you have submitted it, whether or not anyone is working on it, etc. It really is better than phone service in my opinion.

HostICan

The Best Shared Hosting Package I’ve Ever Seen

If you just want a low cost shared hosting account, I have never seen a package that is better than the BaseHost package with HostICan. It is $6.95/month and you get 2,000 GB – yes about 2 Terabytes of data storage. You can host 2 different domain names and get a free domain name for life when you sign up. The free domain name is at least worth the cost of one month of hosting each year. They offer a 99.9% uptime guarantee. If you want a WordPress blog, the WordPress software is already there and ready to go. So this is great account to have if you want to host your own blog. You can even get SSH access but that adds a little to your monthly cost. They no longer support Ruby on Rails. But, if your building Rails apps, get a VPS account at RimuHosting.

IDs With Square Brackets And jQuery

Posted on July 8th, 2008 in CodeIgniter, PHP, Web Development | 4 Comments »

I have recently become quite fond of using jQuery as my javascript library in conjunction with my CodeIgniter PHP projects. In PHP, I often name my form fields in the format of…

model_name[attribute_name]
For Example...
contact[first_name]
contact[last_name]
etc.

I do this so that I can easily retrieve all the attributes for each model and then quickly store them to the database using CodeIgniter’s database helper functions. For example, taking advantage of the Active Record Insert Syntax, I might write PHP code like this…

$contact = $_POST['contact'];
$this->db->insert("contacts", $contact);

When I started to use jQuery to do some client side javascript validation on my forms it was not immediately obvious to me that I needed to escape the square brackets in the jQuery calls.


Due to javascript’s encoding, you need to use double slashes – not just a single slash – to escape the square brackets.

Ecommerce with CodeIgniter

Posted on May 15th, 2008 in CodeIgniter, PHP, Web Development, Zend Framework | 4 Comments »

Ironically the Zend Framework is marketed with the phrase “Extreme Simplicity & Productivity”. I have developed a few sites with it now and I find it to be anything but simple and productive. It’s complicated, has a steep learning curve, and (in my opinion) needs a lot more work. I realize that I’m coming from a RoR background and that is a lot for a PHP framework to try to match. Nevertheless, I am quitting all Zend Framework development until more work can be done on the framework. Then, maybe I’ll reconsider.

I have found CodeIgniter and have now built 3 sites with it. It’s simple, easy to use, speeds up development, has great documentation and, best of all, has won me as a fan. My most recent CodeIgniter project is an educational/e-commerce site about Rebounding with the Cellerciser While developing the site and reading the site content, I was convinced of the many reasons to use a Cellerciser I’ve now been using a Cellerciser for about 3 months and I love this thing!

Read the rest of this entry »

How To Sort A Zend_Db_Table_Rowset

Posted on February 14th, 2008 in PHP, Web Development, Zend Framework | 3 Comments »

So you figured out how to define the relationships between your Zend_Db_Tables and you have issued a call to findDependentRowset(). You get your Rowset back but you need to sort the results by one of the columns in the dependent table. How do you do that?

The short answer is, you can’t! Unfortunately, this functionality won’t be available until the 1.5 release of the Zend Framework. But you can write your own utitlity function to sort your Rowset for you.

Read the rest of this entry »

How To Implement Partials In Zend Framework 1.0.3

Posted on February 11th, 2008 in PHP, Web Development, Zend Framework | No Comments »

The pre release of Zend Framework 1.5 has been out for a few days and includes an implementation for partials – among other things. But the GA release is still at least a few weeks off and I’ve got a project that needs to go live very soon. So, I’m using version 1.0.3 of the Zend Framework released on 11/30/2007, and I want to make use of partials in my project. The trick involves three steps.

  1. Create a View Helper
  2. Access your Zend_View object from the View Helper (or instantiate a new one)
  3. Render a view script from within the View Helper

Read the rest of this entry »

QuietHeadphones.com Goes To Zend Framework

Posted on January 24th, 2008 in PHP, Web Development, Zend Framework | 1 Comment »

A while back I wrote about using Ruby on Rails to develop noise reduction headphones. Tonight, we made the move to the Zend Framework. We did this for a variety of reasons including the fact that we are now hosting our site on a dedicated server with RackSpace. RackSpace is the absolute best hosting company on the planet provided you can afford their rates. RackSpace does not “officially” support Ruby on Rails. This was one of the significant factors in choosing the Zend Framework. Check back soon and I will have a fairly comprehensive comparison of our experience in developing an ecommerce website with the PHP Zend Framework versus our experience building the exact same site with Ruby on Rails.

In the meantime, we have two new products on the website. By popular demand, we now have an amazing set of speakerless noise reduction headphones. We also have a great budget set of noise canceling headphones that are smaller than our premier EX-29 Extreme Isolation Headphones. This makes them great for travel!

Add View Helper Paths For Entire Zend Framework Application

Posted on January 17th, 2008 in PHP, Web Development, Zend Framework | No Comments »

I have been writing several Zend_View_Helpers to aid in the development of my Zend Framework Application. The helpers are very generic and are used in many of my Views throught my applications. So, naturally, I want an easy way to configure my Views to have access to my custom View Helpers. You don’t want to override the init() function in ALL of your controllers to set the View Helper path. Instead, set it in the bootstrap file – your index.php file in the root directory of your website. You do it like this:

$view = new Zend_View();
$view->addHelperPath("DU/View/Helper", "DU_View_Helper");
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);

Put those lines of code in your index.php file somewhere before you call dispatch() on your front controller and all of you view scripts will have access to your own library of View Helpers.

My company’s name is Digital Underware so I have my library set up just like the Zend library in the lib directory of my application. The path to my View Helpers is lib/DU/View/Helper just like the path to the built-in Zend View Helpers is lib/Zend/View/Helper.

If you are interested in seeing a complete example, take a look at this bootstrap file.

How To Remove External Repositories From Subversion

Posted on January 8th, 2008 in Ruby on Rails, Web Development | 3 Comments »

I was trying out a plugin in my Ruby on Rails application and decided not to use it. Apparently, when I installed the plugin, a reference to it was added to my subversion repository. Since the reference was not to a working directory, my capistrano deployments got debackled and died. Here is how you can remove external repositories from subversion.

If you get a message like this one when you are working with subversion:

Fetching external item into 'vendor/plugins/...'

Change directories so that you are in the root of your Rails application and issue the following command:

svn propedit svn:externals vendor/plugins

A list of the external plugins will appear in your default editor. Mine is vim. Delete the link that you no longer want, save the file and commit your changes.

Setting Up Subversion And Apache for Ruby on Rails Development

Posted on July 20th, 2007 in Ruby on Rails, Web Development | 1 Comment »

I’ve been asked several times how I have my Ruby on Rails development environment set up. The most frequently misunderstood aspect of a Rails development environment is that you do not have to have your Subversion repository physically located on the same server as your deployed application. The only requirement is that all the pieces of your development environment puzzle need to be able to access one another over the internet. So, here’s how I have myself setup. It works on both linux (Ubuntu) and Windows XP.

Read the rest of this entry »

Get Adobe Flash playerPlugin by wpburn.com wordpress themes