Skip to content


Search Results for: php framework

Reader Input: Picking A CMS – Part 4

In The Series

So, when we left off in part two, I was leaning towards Wordpress as a candidate for a CMS. It’s popular, has tons of themes, plugins, etc. It’s almost perfect, but for only certain situations.

Enter Drupal

Now, I’ve been hearing a lot about Drupal. For years now. I tried it once and I didn’t like it. However, since then, I’ve revisited it. And I’m happy I did.

I must admit, it had a lot to do with president Obama winning the election. The redesign of Whitehouse.gov was an eye opener. So I thought, if it’s good enough for the president, maybe I should give this thing a second look.

Drupal Pros – Reminds Me Of Wordpress

  • Popularity – Again, like Wordpress, a popular CMS is going to have an advantage over most newcomers because of support and community contributions.
  • Modules – There are a lot of modules out there that will do most of what your mind can imagine out of the box.

A Bit On Open Source And Some Baz Background

This has always been a touchy subject, especially in larger computer firms. But first, let me tell you how I got into Open Source. I started coding in Turbo Pascal 7.0, in about 1996 when I was in Grammar School. I took Turbo Pascal more as an introduction to Programming, instead of a product to do something constructive in.

After Pascal, I was looking into something visual. Hence, I fell into Visual Basic 5.0. Yeah, I know, I’m sorry.

Legal Issues

Now this was my first step towards the open source community. I must admit, that I downloaded a pirated copy and ran with it for a while. Now, that was all well and good when I was sitting home playing around with stuff. But when it came to actually, to producing something for a market, you can’t (or should I say, shouldn’t) do that with pirated software.

After that, I got into web development. For this, there was a plethora of free tools available, for use. So I did that for a while. When I got back to college, I got into C++ (using Visual Studio, but still essentially free). That was a step in the right direction. However, as the semesters went on, we got more into using the .NET library. However, for my web development I never got into ASP.

The First Real Plunge into Open Source – Enter PHP

Bit by bit, web development gave way to web programming. This is where PHP came in. I got more familiar with PHP when I started working on different projects for clients. I chose PHP for a few main reasons:

  1. Free Documentation: I could learn almost everything I needed through online documentation.
  2. Cost: My first problem was hosting. ASP hosts used to be almost twice as expensive as their Linux counterparts.

The Open Source Misconception

One of the problems that people have with Open Source is that they think that it’s unsupported. People seem to think that open source software is written by a bunch of kids in basements or something. This is not the case, by any means.  For example, a lot of the Linux distributions are totally free and totally supported.  Wake up people; free doesn’t mean unsupported. The whole “You get what you pay for” isn’t always true.

Stop Hating On PHP And Learn To Code Better

So here we have the timely battle that PHP faces. Frankly, I’m getting sick and tired of this. All in all, I’d have to agree with Jeff on this one, to a certain extent.

They Say PHP Sucks

You’ll hear the same claims every single time: “Google PHP Sucks you’ll see how much PHP sucks”. Oh please! This is some of what the haters usually use for the argument:

  • There are too many functions
  • PHP Isn’t OOP
  • Everything is strung together – This claim usually talks about the interaction between PHP and/or SQL

In Defense of PHP

The number one claim is that everything in PHP feels like it’s clunky and may fall apart at any time. Granted, I’ll be the first to admit that I hate boring SQL queries. Keyword here is boring. Within the past year, I’ve really gotten to see that SQL has a lot of power. Learning of all of awesome power, just makes me hate writing crap like:

select title, body, post_date from posts where id = 32

Functions, Functions, Functions

I, myself, have never really understood the “too many functions” argument. Maybe it does make the documentation a bit muggy to get through, but how many functions that are in there have very little to do with me. I don’t care, I just use a handful of them.

Twitter to Bite the PHP Bullet?

One of the big things you’ll hear about Ruby on Rails is that it’s hard to scale. In my opinion, that’s not really an issue that one should be addressing on the framework level. Scaling, in my opinion, should be something reserved for backend databases and servers. From what I’ve read, you should be able to slap on a MySQL proxy and an Apache load balancer in front of multiple mongrel servers, but I digress.

With all the Twitter Rails scaling issues, it’s funny to see this headline from TechCrunch. Guys over at Twitter have renounced this claim though.

Will this make me abandon my quest for learning Ruby on Rails? I highly doubt it. Scaling becomes an issue on extremely high traffic sites. And a lot of the issues that come into play with such a high traffic site, can be easily remedied by things like optimizing queries and caching.

Source: Twitter Said To Be Abandoning Ruby on Rails [TechCrunch]

Do We Not Understand What Bias Means?

Somehow I don’t think most people understood what my bias comparison of CakePHP vs Ruby on rails meant. The last few visitors to comments seem to have been Rails fans. One of them seems to think that I shouldn’t touch Ruby on Rails with a ten foot pole and should stick with CakePHP. He doesn’t want someone like me in their community. The other comment, I get the opposite vibe from. He strikes me as a PHP fan, who thinks I’m too lazy for the PHP community.

To all the folks that haven’t seem to understand my whole objective, let me help you guys out. I have general interests in a lot of areas and I also work a 9 to 5 job. So I don’t really have the time and dedication required to poor my heart and sole into everything that comes along. I do a brief overview of something before I spend tons of time delving into it. People are pissed that I’m comparing CakePHP to Ruby on Rails and haven’t even tried it yet. This is where the brief overview comes in; I took a quick look and realized that for what I was doing at the time, Ruby on Rails would have been more trouble that it was worth.

Your Choice of Web Development Framework Doesn’t Matter

After reading about Matt’s Experience with the Zend Framework, I came to the conclusion that one’s choice of a Web Development Framework doesn’t really matter. There are tons of frameworks out there and there’s a good reason for that. People still use them. If no one used a framework it would die a quick and painless death. Different frameworks offer different benefits to different people.

However, I’m willing to bet that First Choice is one of the main factors affecting a developer’s choice of framework. I fell into CakePHP first because I had an initial choice of CakePHP and Code Igniter. I couldn’t quite get CI working quickly enough, so I jumped on CakePHP and I’ve been here ever since.

Something else which solidifies the First Choice method is that the frameworks are sufficiently different that there is a learning curve when moving from one to the other. If you’ve started using one framework effectively, learning another (even to discover potential benefits) is usually not worth the time.

So I say this to you; be confident in your choice of a web development framework. Code Igniter, CakePHP, Symphony, even Ruby on Rails, it doesn’t matter and no one cares as long as you can crank out functional web applications in a reasonable amount of time.

Top 5 Basic SEO Tips – You Can Do These Yourself

In the last five (5) years another key phrase hit the Web Design scene and hit it hard. SEO or Search Engine Optimization is that phrase. It deals with optimizing the content and code on a website to cause the page to rank better in different search engines. Gone are the days when you slap some keywords and a description in the META tags and call it a night.

Now SEO is an entire business by itself, sometimes completely separate from the design process, so it should not be taken lightly. But, a little is always better than none. So here are some basic tips that you can use to help your pages rank better for your desired keywords.

1. Structure Is Everything – Titles, Headings, etc

As I said before, ye ole’ meta tags are less effective. As a matter of fact, some search engines completely ignore them. There are, however, tags that search engines do consider:

  • title
  • h1, h2, h3, etc
  • strong, em, b, i

Poll Results – What Do You Look for in a PHP Framework?

Poll results for What Do You Look for in a PHP Framework are in:

What Do You Look for in a PHP Framework

Most of you prefer a framework that is Quick and Easy. Hey, I’m totally with you guys on that. When deciding on a web development framework, it has to be easy. It’s no fun if it takes hours to learn and saves you minutes. For me, CakePHP definitely fits this bill. The bake routines save me so much time during initial development.

Next on the list was a Less Code Needed and a Small Learning Curve. Again, that would definitely fit high on my list. I’m sorry, I’m just lazy that way.

That last result on the list is interesting, but expected. Not many people needed the framework to have a Small Footprint. With the type of processing that is required nowadays, sometimes the lite/light version doesn’t cut it. With that said, we also have a lot more processing power to push those heavy frameworks along. In my opinion, it’s less important that a back end framework be light as apposed to a JavaScript framework. The back end is handled strictly by the server, so the user doesn’t take the hit. With a JavaScript framework the user needs to download the entire thing. In this day and age it has become more cost effective to through some more CPU at the problem while saving weeks (or even months) in development time.

CakePHP vs. Ruby On Rails – A Very Bias Look at Why I Choose CakePHP

First of let me state that this post is very bias towards CakePHP. Truth be told, I haven’t even installed or used Ruby on Rails. The closest I’ve come is looking at various code snippets I’ve found around. With that said, you may want to stop reading now.

These arguments are not based on hard facts, since I haven’t done much research on the matter. A lot of them come from a post at Clickable Bliss discussing the PHP vs. Ruby On Rails Issue.

  1. Steep Learning Curve – Laziness

    One thing I really hate is learning stuff. It is especially bothersome when you’re trying to crank out a project or web application in a limited amount of time.

    With CakePHP I’m required to learn about the MVC style of development as well as CakePHP conventions.

    With Ruby on Rails, I would have to learn MVC, Ruby on Rails conventions and I would have to start from scratch with the Ruby programming language as well.

Give Me 15 Minutes and I’ll Make You A jQuery Expert

Introduction

jQuery - Write Less, Do MoreIn the spirit of rapid web development, I’ve stumbled upon jQuery. Here’s a testimonial from a jQuery user:

You start with 10 lines of jQuery that would have been 20 lines of tedious DOM JavaScript. By the time you are done it’s down to two or three lines and it couldn’t get any shorter unless it read your mind.”

In my experience it’s been more like five (5) lines of jQuery.

jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.

I’ve found jQuery great for the following reasons:

  • Simple Ajax in a breeze
  • Search for elements in the DOM is made easy
  • The helper function [ $() ] is a pleasure to use
  • Most importantly: it handles cross browser compatibility.

Here We Go – Tutorials Galore

Your first step will be to Download jQuery 1.2.1 and include it in the head of your web page. After this you need to start reading some tutorials. Don’t worry, it’s going to take 15 minutes tops for you to start writing usable code:

The Secret of CakePHP Advanced Routing – Even Better URLs

The power of CakePHP has a lot to do with conventions. The framework (like many others) harnesses its power by enforcing certain conventions and standards that users must follow. You name your database tables, file names, etc; a particular way and boom, models, views and controllers are automatically created and ready for use. This is the beauty of the MVC structure. Your URLs also follow thing structure: www.site.com/controller/action/params.

Straying From Convention

But sometimes, conventions suck. Sometimes you want greater control over things, but still don’t wanna do them from scratch. The strictness of the MVC structure dictates how your URLs will look. Consider this: CakePHP has a basic pages controller, which you can use when you don’t need a model or controller. You just enter the view and voilà , a page. But your pages have a URL of:

www.site.com/pages/page

Wouldn’t you rather:

www.site.com/page.htm

The Routes Configuration examples in the CakePHP manual are a bit simple. Here’s how to use a bit more advanced routing:

Router::connect('/(.*).htm', array('controller' => 'pages', 'action' => 'display'));

This says, consider everything that comes in with an HTM extension and send the URL as a parameter to the display action on the pages controller.

The idea was stolen from Lumad CMS. They use the following in Rewrite in .htaccess for their pages:

RewriteRule ^~(.*) content_pages/displayurl/$1 [L]
They use a prefix of ‘~’ instead of a suffix of ‘.htm’, but you get the picture. I’m sorry to disappoint you, I’m not as creative as you thought.

CakePHP Installation Guide: Just Add Water and 2 Medium Eggs

Introduction

As you guys know, I’ve recently discovered the marvels of rapid web development with CakePHP. This shall be the first in a long serious of CakePHP related material coming from me since I’ve now veered off on a slightly different focus.

After a short analysis, I’ve picked CakePHP as my framework of choice. I’ve been struggling through it for a few months now, but it’s by far better than the alternative of coding by hand (Yeah, I know I’m lazy). I’ve struggled through it so that you don’t have to.

Downloading – Stable or Alpha Version

Step one is downloading CakePHP. The first problem that you’ll run into is that there are two (2) versions to pick from: Stable 1.1 and Alpha 1.2. When I first started out, I needed to use CakePHP for a project instantly, so I decided to with the stable version because the word alpha scared me a little bit. I mean, it’s not even beta yet.

New Domain: WebDevelopment2.com, New Focus: Frameworks, CakePHP, Javascript, Web 2.0

New Domain

I has finally occurred to me that I should have gotten my own domain name a long time ago. Really, I don’t know what I was waiting for, but it was about time. Since my focus is Web 2.0, WebDevelopment2.com was an obvious choice. I’ve already written about moving wordpress to a different domain, so moving to this domain was walk in the park. I loaded up PhpMyAdmin and exported my database. Pulled up Notepad++ and did a search and replace for my old URL to the new one. Saved the file, zipped it back up, and uploaded it to the server. Since I usually deal with large databases, I didn’t even bother trying to load into PhpMyAdmin. Bigdump is now my favorite database importer for MySQL.

Finally, I loaded up the .htaccess file on the old domain name and slapped in a RewriteRule with a 301 redirect to WebDevelopment2.com. And Viola, here we have Wordpress blog perfectly redirected, without losing a single inbound link. Sure, the Page Rank on the domain name is 0 (for now), but with a name like Web Development, it won’t be for long.

Enter CakePHP – Rapid Development Framework – No Really!

Almost two months ago I mentioned that I was looking into some PHP Frameworks I must say, that I’ve procrastinated with the whole thing. Since then I’ve caught up on a few. A friend of mine tried introducing me to Code Igniter framework. I didn’t really get a good feel for it. He mentioned that it was more powerful and flexible, but I’m lazy, so I was looking for a lazy man PHP Framework.

Enter CakePHP

Here’s a bit of background. I know you’ve heard of Ruby on Rails (RoR). I mean who hasn’t? Well, I’m one of those guys who never paid it much mind, and for that I was wrong :) . RoR introduces the MVC model: Model-View-Controller pattern. What these Frameworks do is bring this pattern to the PHP platform and I love them for it.

CakePHP is a bit simpler than Code Igniter at first, so that’s what drew me to it. However, this weekend I stumbled upon the Baking capability of CakePHP and I was hooked. I have an upcoming project, which I’ve decided to use CakePHP on. I will keep you posted on how things go.

This is what helped me make my decision: CodeIgniter vs. CakePHP

Reader Input: What PHP Framework Do You Use?

There are a bunch of PHP frameworks, too many if you ask me. I’ve tinkered around with CakePHP, Zend Framework, and Code Igniter. I’m curious to know what you guys have been using and what you find quick and easy.

What do you look for in a PHP Framework?

What Do You Look for in a PHP Framework?

  • Quick and Easy (56%, 14 Votes)
  • Less Code Needed (16%, 4 Votes)
  • Small Learning Curve (16%, 4 Votes)
  • Small Footprint (12%, 3 Votes)

Total Voters: 25

Loading ... Loading ...

PHP vs. VB6

This is funny. I can’t tell you how funny this is. They’re actually comparing PHP to VB6. Basically, VB6 sucks as a language and for that reason should be reduced to scripting where as PHP is somewhat similar because it makes an excellent scripting language.

Karl over at CodeBetter.com writes:

PHP is NOT Object Oriented
As a language, PHP’s object-support is quite rich. Since the introduction of PHP5, developers have had the same level of OO support as most other languages. Of course, there’s nothing forcing developers to use OO principals.

Layering
The only support for layering offered by PHP is the include/require functions. Like OO, proper layering can greatly increase code readability and maintainability. Much like in classic ASP, most developers tightly intertwine their PHP and HTML.

Exception Handling
Exception handling in PHP is like object oriented programming – it’s supported but not used. The PHP framework scarcely makes use of structured exception handling as do most of the online samples. The example which always gets under my skin is the MySQL library.

Other Issues
The fact that PHP is a loosely typed language can lead to significant difficulties for larger projects. Strongly-typed languages like C#, VB.NET and Java can take full advantages of compile-time checking and design-time tools (IDEs) while loosely-typed ones generally can’t.

Web Development vs. Desktop Development

An interesting article from John Carroll | ZDNet.com explores the differences between AJAX and desktop development.

Ajax is rapidly growing into something a lot of developers did not expect. Web designers can now design flashier web pages (minus the Flash). Other web designers are bridging the gap between desktop applications and web applications. Users have begun to take strong notice to this and are, in some cases, requesting such advances in web development.

From a user perspective, though, AJAX applications – such as Google Maps or Microsoft’s Web Exchange client – are simply web applications that more closely approximate features normally associated with traditional, standalone desktop applications.

All this is all well and good. Ajax is a wonderful new technology, which we should all try to explore and exploit to its full capacity. BUT, that JavaScript portion of Ajax is causing some problems, as John notes:

The fact that you can write interactive web sites in Javascript, though, doesn’t make Javascript a great programming language for complex site development.