I’m a little embarrassed to see my rant from 2 years ago show up again. I’ve been using my modification of narayanis’ version of Colin Williams’ code and it works great.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
July 29, 2007 7:19pm
Subscribe [10]#16 / Aug 17, 2009 8:43pm
I’m a little embarrassed to see my rant from 2 years ago show up again. I’ve been using my modification of narayanis’ version of Colin Williams’ code and it works great.
#17 / Aug 19, 2009 6:27am
interesting thread none the less (showed up as second result when searching “codeigniter crud tutorial” 😊
I am half-developer, in the sense that I am self-taught about PHP (and currently learning CI) as this is the only way I can realise my ideas without having to hire a developer (cannot afford that for my little things).
I have developed some sites without any framework and it’s true that after a few years I am lost at what I did back then. Let’s forget if I had to hand this over to a developer.
That made me realise I needed a standard way of developing (i.e. a framework) so that if one day my site takes off I can always hand it over to a professional developer who can follow what I did without too much trouble.
If you are a developer you definitely need to know a framework as this will be what customers will demand (I would hire a non-framework developer).
As a newbie on CI, I was suprised to see so few “standard” applications built on the CI framework. I only found some crappy samples.
Look at Magento for example (http://www.magentocommerce.com/). They built it on the Zend framework, which means that any Zend developer can become a “Magento Developer” as he will be familiar with the code conventions and he will only need to learn the specific functionalities of the application (something a developer needs to do anyway for each project/application). On top of that Magento has a complete eco-system for plugins, etc etc.
My general suggestion is that CI developers should put their brilliant heads together (I’d love to be able to put into code my ideas as quickly as you guys can) and come up with some standard applications that blend well together making use of the CI framework.
ExpressionEngine seems to be heading that way, but it will always be tied to EllisLab and dependent on what decisions they take.
If you build something similar, but make it open-source, you can create a very healthy eco-system for CI developers as long as there’s good guidance and governance of the project (open-source forks end up doing more bad than good to the open-source community in my personal view)...
Luca
#18 / Feb 25, 2010 11:58am
edit - oops. Was looking at the wrong file - and therefore asked a dumb question.
#19 / Aug 13, 2010 2:03pm
Look at Magento for example (http://www.magentocommerce.com/). They built it on the Zend framework, which means that any Zend developer can become a “Magento Developer” as he will be familiar with the code conventions and he will only need to learn the specific functionalities of the application (something a developer needs to do anyway for each project/application). On top of that Magento has a complete eco-system for plugins, etc etc.
ExpressionEngine seems to be heading that way, but it will always be tied to EllisLab and dependent on what decisions they take.
The way you say it, it sounds the same thing. In both cases a company is releasing a product based on some open source code. In both cases it will always be tied to whatever decisions the company makes.
#20 / Jun 14, 2011 12:26am
You can use something more simple like grocery CRUD
#21 / Jun 14, 2011 2:48am
There’s a lot of example applications in the wiki and on bitbucket. My Community Auth application is small, updated to 2.0.2, and would be easy to pick apart and see how basic CI usage can be done easily. There are no instructions for using Community Auth, but if you browse the files you can see how I did things. It’s very well commented.
#22 / Jul 02, 2011 9:59pm
I’m currently developing a CMS with CI and i’m tackling the same issue. The way i’m going is by creating extending controller classes in combination with an ORM (datamapper) which has the validation within it. Having the models self-validate leaves a TON of room for bizlogic and couldn’t be more helpful.
Start with creating a CRUD_Controller which extends the base controller (or another extend) and running perhaps a switch statement within _remap before calling the method. The _remap loads the template according to the class/method name, and the method would load the data into the template. This way, to add a CRUD controller for say, a User model, you’d have
class User extends Crud_Controller { function User() { parent::Crud_Controller(); } // Create, Read, Update, Delete methods inherited // User-controller specific methods and CRUD overrides go here }views/templates could then be constructed with some automation (in _remap) based on get_class($this), ie. ‘User’, to figure out which model templates to load.
if that all sounds complicated, it’s cuz it is 😛, but if you can create a standard file structure you could use this method to produce a mostly-automated crud and then all you’d have to do is create view files and an override here and there. Plus it gives you access points to base crud operations allowing for insertion of ACL and such.
n
I’m about to do something similar to get CRUD up and running quickly with a new app. Any way you could elaborate further on your implementation with remap or point me in the right direction?
Thanks