PHP Coding: Do you use a framework?

stugster

Free Member
Feb 1, 2007
9,060
2,076
Edinburgh, UK
considerit.com
I've never ever touched any framework software for my PHP development. I'm a fan of Eclipse for Java, but for PHP, I've always relied on good old notepad++

It's getting to the stage where a lot of the work I do contains the good old repetitiveness of programming; login scripts, input verification, validation, sql server connecting...

What frameworks (if any) do you guys use, or what libraries do you call upon each time?
 
I'm like you - don't use a framework but do use a series of 'mini-scripts' that are just saved as PHP files and copied/pasted as when I need them.

Would also be interested to hear about what others use.
 
  • Like
Reactions: stugster
Upvote 0
Pear is probably your best bet, frameworks are ok, but really you want a templating system :)

You could use Perl Template Toolkit with PHP, I use TT for nearly all projects be it GUI, Web, Python applications etc. Separating content and code is a good idea.
 
Last edited:
  • Like
Reactions: stugster
Upvote 0
Hi slugster
I use HAPEdit as an editing tool, which enables me to work in a development project. The project may comprise php scripts, include scripts, javascrips, plain html or plain text. HAPEdit is a free resource.

From a framework point of view, I try to carve up my code into re-usable include modules, which may or may not be classes. So if I need logon capabilities, I include my logon class. If I need a 'contact me' form, I include several php scripts: one for each step of the process.

If I want MySQL database access, I have a DAO class for that. If I want some other database access, I have a DAO class for that. This enables me to use the same SQL language in my scripts, which is interpreted by the DAO class I am using. For example, the connection to MySQL is different to the flat file database I am currently working with, but only the DAO class changes. Does that make sense?

For a more defined framework, you might look to Smarty. I did some research some time ago on many options and Smarty was a bit complicated and somehow restrictive for my needs. I googled a great deal and saw some great ideas, which was what led me to where I am now. It works for me, but may not for others.
 
  • Like
Reactions: stugster
Upvote 0
I'm a big fan of Zend Framework

I use Geany for coding which is a fast lightweight IDE with some basic features (code completion etc) but not bloated or slow.
 
  • Like
Reactions: stugster
Upvote 0
I've got a framework site that I use, which has got all the basics - even runs a standard DB setup script - and I reckon that saves me a lot of time.

As yet I haven't found a decent use for the full-on frameworks like CakePHP or Symfony, and I guess maybe I'm just not organised in that way, but I can always find some reason for not using it, some use-case that doesn't fit with how the frameworks want them to be.

But a basic set of files (index, css, images, admin, login/logout, etc.) is, I would say, a huge benefit.

The other thing I do is have one file (usually called 1.php or somesuch) that's like a config file, and gets called at the start of every page. It means I don't need to worry about changing things in loads of files every time I set up a site, I just change the settings and defaults in 1.php, and can see a basic working site very quickly.
 
  • Like
Reactions: stugster
Upvote 0
I'm running a small scale Web Development Company. We're mostly using CodeIgniter Framework for our projects.

It's easy to learn and have a good community around.

Cheers
Dare
 
  • Like
Reactions: stugster
Upvote 0
Not the correct answer but you can build extenstions in dreamweaver that you do most of it for you, you can also build bits into dreamweaver to add scripts quickly, so when you see the php or asp tab you can set additional tabs or change that one and put in your own scripts etc, so if you used the same login script in all sites it could be done in one click.

I don't think notepad has this function and wouldn't suit everyone:D
 
  • Like
Reactions: stugster
Upvote 0
I have been recently looking at frameworks such as codeigniter but can't see a real advantage for me to use it for the projects we work on, plus my understanding of oop/mvc isnt great at the moment.

I use coda when on the mac or dreamweaver code view on the pc. I also have a series of scripts i regularly use to speed up coding.
 
Last edited:
  • Like
Reactions: stugster
Upvote 0

Latest Articles