CodeIgniter Forums

Full Version: CI/PHP tools and processes you shouldn't be without
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Time for a fresh one I think - what CodeIgniter and/or PHP related tools and methods do you use that really make a big, big difference for you and you just refuse to be without? Anything thats a big part of your development process.

One requirement - only include things you'd use for live, "I expect to get paid for this" kind of websites, not just bleeding-edge cool to play with "but I've never put it on a client's site" type stuff. Big Grin

- To start, WampServer (or XAMP for that matter) to make it easy to get a WAMP stack working in just a few minutes, since I use a windows box for development.

- An IDE - any one you like. I use PhpED, but have heard so much good about Aptana I'm thinking of trying it just for fun one day Smile The main value I've found is making it easy to save, manage, search, upload, and of course if you don't have code highlighting you are making your life so much harder than it needs to be. I use to use EditPlus and I loved it for years, but debugging support it worth any price...which leads me to...

- Debugger - oh god, so much better than var_dump-style bull. One breakpoint and you can, at your leisure, walk through code a line at a time, jump in and out of functions, see what variables exist in various scopes and their values at any time, see what loops are executing and the flow your program is taking. Honestly, I value this (even if it took you 3 days to get it working right) more than having a localhost server and IDE combined. I can't say how much time it saves.

- Profiling in CodeIgniter. I didn't use this until recently, but what a difference:

It also helps me alleviate worry about slowing down a site from DB queries or just using a framework at all. Also it spits out the SQL of queries that are being run, which is really dang handy.

- ORM, Object Relation Mapping, 'no more SQL for you!' - Datamapper OverZealous Extension (DMZ) is my fave, but whatever brand you want it's just such a big deal for me. It's hard not to exaggerate because of the cool factor, but with a level head I see these main big advantages. - Move form validation to the model. So passwords get encrypted before being compared, usernames are unique before an account is created (dmz provides the 'unique' validation rule to handle this, quite a time-saver), and you set this up once where it really matters - before database interaction. Forms become cleaner and simpler.

With DMZ I have found it is now a breeze to reuse a form for creation and editing, and even admin functions, with much less work and replication. You'll rarely need to specify validation rules in your forms any more, making forms less of a time sink. This alone is cool.

Complex databases now become simple to manage. You can design DB structure the way it should be, to best reflect the nature of the data and how it will be used, without worrying about how many lines of code it might take to interact with it - because it will utlimately probably only be 1-4 short lines, or a 2-line chain if you are using PHP5.

- MVC - yeah, that's what CI sort of 'is', but its easy to not really follow the guideline. Its easy to write sql into the controller along with html output, use views only for some things, etc. But with my second CI project I'm just loving the simple beauty of a well organized program. Everything in it's place, no questions about what you'll find in what file, etc.

- Organized Views - hey, you can build folders and subfolders into your views files. You probably knew that already, but I didn't think about it until recently. Now I have a form file with basic forms as well as a success and failure folder to make it easy to find what view controls what event. I have navigation and templates it its own folder, and special admin-only type pages will have their own folder. Seemingly minor, but as a project grows you'll spend a little less time going "hm, so where did I put the file that is doing that...".

I've been looking into source control Wink But I don't have experience personally so I won't comment.

For Auth I still create my own, it seems so easy and straightforward I don't see the point in using a library.

So, what made such a big difference for you that you just refuse to go without it?

El Forum

[quote author="BrianDHall" date="1252111244"]
So, what made such a big difference for you that you just refuse to go without it?

As part of my attempt to get a bunch of 'subjective approaches to common problems' loaded up into the wiki, I set up a category for 'what do you do after you've installed CI' and it seems pretty much aligned with the kind of thing you're talking about here.

I think it could be a really useful resource for new users to browse through and get a take on the very different ways people set up their development environments, and the number of different tools that are available to help.

My page (incomplete) is [url=""]here[/url], and it would be great if you wanted to write something similar. It'd be a matter of creating a page at [url=""]this url[/url] and editing it (though you might want to copy across the source template from my page - the category stuff is a bit messy if you're not used to the CI wiki way of thinking).

El Forum

Does a single idea that was generated independantly by two people count as two great ideas? I don't know, but they're (it's) great anyway. Thanks to you both - I've got some great ideas from your page/thread and will start a page as jedd described shortly.