views:

430

answers:

12

I'm about to start on a small, static website project: no database or CMS required. Basically, a brochure website.

I used the CodeIgniter framework recently to develop a full-blown web application, and I'm wondering if it appropriate to also use CI for smaller, simpler sites.

Typically for a static brochure site I would write regular PHP pages with a few includes thrown in to save on repetition (i.e. HTML with a sprinking of PHP), but this time around I'm wondering if my new friend CodeIgniter might be able to streamline the development process.

Is it sensible to consider a framework for such a simple project, or is it overkill? I'm worried that I might be the proverbial carpenter whose only tool is a hammer, and sees every problem as a nail!

+1  A: 

If you don't need a database, CMS and is just a simple static HTML/css/PHP page, I don't think you can go wrong creating a site without a framework. Plus, if you have been using frameworks for a long time, you can have a break and do "code for code" and have a feel what it's like to code from scratch :)

ggfan
+8  A: 

I think almost never, the needs change and come more with time... so it is better to have a good base using a framework to wait the future needs. but if your project will not have a long live time and your needs are reaaally simples then i think is not necesary use a framework.

zerofuxor
+2  A: 

I personally would never develop a site outside of a framework for anything more than a single page brocure-ware site. I work so much faster inside the framework.

I'm a Python/Django developer but here's my take.

I've done some small non-framework sites with PHP and I don't know how PHP frameworks compare to DJango, but if they're anything alike the fact remains that I'm far more proficient developing within a framework than to code something from scratch by hand.

It helps me stay organized if nothing more than giving me the VC of the MVC. Django provides me with a lot of built-in tools, like form handling, that make my life much easier even for small sites.

I'm going to presume PHP frameworks provide similar things, maybe not though.

You also can't anticipate how the site will grow over time. It's easier to maintain something built in a framework, and if you ever need to extend the site in the future it's nice to have some structure behind it.

digitaldreamer
They do... I actually find Django to be quite "loose" with the structure it imposes... a little too loose in fact; I don't quite like it. Something like CakePHP which believes in Convention Over Configuration can really cut down on time setting up routes, and deciding on template names, folder structure and other things... Django provides a lot of tools, but I found extensibility a lot better/easier in Cake, whereas if you need something more in Django it's harder to build on top of. Case in point, the User class which forces you to go down this "profile" route, a separation I find to be ---
Mark
--- entirely unnecessary and annoying. But alas, it has many good points as well. Anyway, point is, PHP frameworks are good for cutting time and providing structure as well. They each have their strengths and weaknesses (Django has a much better ORM IMO).
Mark
The orgainzation you describe (the VC of MVC) is also what appeals to me. I've not worked with Django, but CI certainly has HTML helper functions, form validation classes, and the other time-saving stuff you expect in a framework.
Jonathan Nicol
I really wouldn't expect anything less from CI, but that's great to hear. I personally wouldn't look at performance as a deciding factor. Chances are for a small site with no DB scalability isn't going to be an issue. I would evaluate whether or not it'll ultimately save you time to work within the framework. More often than not I opt for the framework; but that's just my personal style. Perhaps the framework would only slow you down.
digitaldreamer
@Mark All of your criticisms are valid and well articulated. I have to agree with you about the Django User. Depending on the situation it can be hard to customize the User model to suit your needs. I will say this though: the User model makes it easy to integrate separate complex apps with little hassle. I can install a registration system, a blogging application, internal messaging, and an e-commerce cart, all written separate independent groups, and they'll play nice with each other because they're all based on the unified User model and authentication backend. ---
digitaldreamer
--- Either way it sounds like you can't go wrong with both systems.
digitaldreamer
A: 

For a simple site like that. why even use a framework why not use something like concrete5. Overkill? definitely. but hey it is easy and requires almost no coding so upkeep is a breeze.

The site would be up and running in less than an hour and it makes you look good in the eyes of your customer and that can't hurt.!

DeveloperChris
+2  A: 

Since I tend to either inherit bespoke frameworks, or write my own, I would peg it at about 3 pages: if it's more, then setting up a framework is worth it. And if it needs a DB, then odds are good you'll end up with more than 3 pages, anyway. :-)

staticsan
Site will be about 40 pages, so by your defintition it is definitely big enough to benefit from a framework.
Jonathan Nicol
If it is a site, not an application (ie not much user interaction besides viewing the pages), I reach for a CMS over a framework. Pretty much anything you would implement yourself has been done for you already. The downside is you feel less like a coder and more like an assembly-line worker, and you will occasionally run into something that is a pain to do the way the CMS dictates, but development is usually much faster.
Jergason
A framework can start as simple as a place to put common functions and page elements.
staticsan
A: 

I don't think any project is too small for a framework, I think some frameworks are too big for small projects. Everyone hopes their website will grow. So no matter how small the site is now, growth will be easier to manage if you start with a framework.

Brent Baisley
A: 

I recommend Rapyd, a "minimalistic and rapid PHP framework".

Jorge
A: 

The only case when framework would be an overkill is with a throw-away scripts, such as when you need to quickly automate something that you won't need to do again ever. For anything that will enter execution cycle more then few times framework is a probably would be better.

Alex N.
A: 

If it requires under several hours of work - then it is small. Anyway if you plan to devote more than "several hours" - definately use a framework AND a control revision system.

Ivan Petrushev
A: 

It depends. If you're positive this is all the site you're working on will ever be, or migrating when future needs arise, then I can't see why there would a reason for using a framework, unless you feel more comfortable working with one.

As a personal example, I recently worked on a semi-static website, for which I put together a minimal framework which worked as a caching preprocessor for static html, inserting common html-elements into preset places. This allowed for some dynamic content, yet still using only static html for content.

I'd say you're answer lies within a formula consisting of future development needs, your own working preference, and performance.

nikc
+1  A: 

Site is never small if the client is there who may want to ask you to add more functionality at any time :)

Sarfraz
A: 

How long is a piece of string?

I use CodeIgniter (specifically PyroCMS) for crappy 5 page brochure-ware but that is purely to let clients admin their own pages easily with a WYSIWYG.

Any client will say "Wow, news, contact form and I can get me some of that Twitter too?!" so I just dump it in there to save everyone time.

If you are developing from scratch there is no point if the content is static. Something like CodeIgniter helps with DB interaction, Form validation and the breaking down of multiple pages into logical chunks i.e Controller classes and methods.

If you have no db-content, don't handle forms and don't have many pages then there is litterally no point adding the overhead.

That said, try my Twiny framework for literally the smallest MVC framework around.

Phil Sturgeon
Thanks Phil. I wasn't too specific about the specific requirements of this particular site, but it basically breaks down to around 40 pages of static content and 4 forms.
Jonathan Nicol