Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 58

Thread: In this thread we will discuss CodeIgniter!

  1. #11
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default

    that was a very good question @jayrulez, I think the problem madhacker is 2 fold. 1. How do you draw a form that will accept the data. 2. how will the posted array look when you ready to insert the data.

  2. #12
    Join Date
    Sep 2004
    Posts
    356
    Rep Power
    0

    Default

    Well Owen I would assume that you are capturing the data from a form which will submit the information to both table.

  3. #13
    Join Date
    Jun 2008
    Posts
    74
    Rep Power
    0

    Default

    Codeigniter is for people who do not care much about improving their knowledge of the technology they use. The development pace is so slow that it hasn't really seen an improvement moving from the initial version to version 2. Version 2 was the perfect opportunity for them to do a ground up rewrite of the framework, but they just patched a few things and changed some text then tried to push the release as ground breaking improvements. All their devs sing about day and night is "preserving backwards compatibility". I agree, breaking backwards compatibility is not a good thing, but sometimes it's absolutely necessary in order to move forward. Their reason for promoting backward compatibility to that extent is that they believe that a project using CI 1.7.3 must run smoothly with little or no changes if the developer upgrades the framework to 2.0. That is utter nonsense. If the code works, then there is no reason that the dev must absolutely upgrade the framework in their deployments. If they want to update the framework, then they should thoroughly read the documentation of the new release and also the change log so they become aware of the changes they need to make to their code base. Problem solved.

    Other frameworks like symfony, zend and cakephp have taken the initiative to leverage the best of php the latest php improvements such as namespace, lambadas, security fixes and many more.

    I've been following the development of symfony2.0 for a while now and I've been impressed with the improvements over symfony1. It has seen a huge performance boost in terms of page execution time and memory consumption. It implements well known design concepts and conventions, it is very extensible and flexible. Working with it over the past few days, it reminds me of working with .NET mvc. I would encourage anyone that is competent in .NET MVC to use sysfony2 if they ever need to use a php framework.

    However, this is not about symfony but codeigniter. In my honest opinion, codeigniter either needs a rewrite to make it even remotely useful or it needs to save developers who are just diving into the world of php frameworks the trouble and close down the project.
    Last edited by jayrulez; Mar 7, 2011 at 10:37 AM.

  4. #14
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default

    ^ wow, ok, but @jayrulez what particularly is wrong with CI 1.7.3 ? what if you just want to quickly build a application with lots of tables and forms? what are the particular disadvantages you find with the frame work? apart from the lack of fancy new php features.

  5. #15
    Join Date
    Jun 2008
    Posts
    74
    Rep Power
    0

    Default

    Quote Originally Posted by owen View Post
    ^ wow, ok, but @jayrulez what particularly is wrong with CI 1.7.3 ? what if you just want to quickly build a application with lots of tables and forms? what are the particular disadvantages you find with the frame work? apart from the lack of fancy new php features.
    If i wanted create an application with a lot of forms and table is codeigniter, this is what i would have to do:

    After constructing the database, I would then have to create model to represent each table.

    This is how you create a model in CI: http://codeigniter.com/user_guide/general/models.html

    I would then have to create an html form to represent each table that would require a form by typing everything manually. eg:

    HTML Code:
    <html>
    <head>
    <title>My Form</title>
    </head>
    <body>
    
    <?php echo validation_errors(); ?>
    
    <?php echo form_open('form'); ?>
    
    <h5>Username</h5>
    <input type="text" name="username" value="" size="50" />
    
    <h5>Password</h5>
    <input type="text" name="password" value="" size="50" />
    
    <h5>Password Confirm</h5>
    <input type="text" name="passconf" value="" size="50" />
    
    <h5>Email Address</h5>
    <input type="text" name="email" value="" size="50" />
    
    <div><input type="submit" value="Submit" /></div>
    
    </form>
    
    </body>
    </html>
    I would then proceed to create controller actions that would render the forms.

    PHP Code:
    <?php

    class Form extends CI_Controller {

        function 
    index()
        {
            
    $this->load->helper(array('form''url'));

            
    $this->load->library('form_validation');

            
    $this->form_validation->set_rules('username''Username''required');
            
    $this->form_validation->set_rules('password''Password''required');
            
    $this->form_validation->set_rules('passconf''Password Confirmation''required');
            
    $this->form_validation->set_rules('email''Email''required');

            if (
    $this->form_validation->run() == FALSE)
            {
                
    $this->load->view('myform');
            }
            else
            {
                
    $this->load->view('formsuccess');
            }
        }
    }
    ?>
    If i had 20 tables, and need 20 forms, then I'd have to repeat that procedure 20 times. Also, their implementation of OOP and MVC is extremely flawed. They do not use auto loading of classes, instead they use a hack of a loader helper. You see it's use here:
    PHP Code:
            $this->load->helper(array('form''url'));

            
    $this->load->library('form_validation'); 
    Also the validation rules are associated with a model, why are they placed in the controller action?

    And here:
    PHP Code:
    $this->form_validation->set_rules('username''Username''required'); 
    Why is form validation a property of the controller?

    I think they have misinterpreted what MVC is.

    I could site a lot more flaws, inconsistencies etc... but this is getting boring.


    Let us say I wanted to accomplish the same thing using for example Yii.

    I'd just need to open the code generator, enter the name of my database, it will extract the list of table in the database. I could then generate a model for all table sin the database. I could then use the crud generator to generate both controller actions and forms for the models. After that, I'd just edit anything that needs to be edited like adding extra validation rules etc.

    That's rapid application development.

  6. #16
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default

    I see what you are saying, very thorough description. Though on that last point you made there about crud auto-generation does have some side effects of tedious and annoying to maintain (but thats a whole other article). So if the forms are so tedious to set up, why are MadHacker and other people using it ?

  7. #17
    Join Date
    Jun 2008
    Posts
    74
    Rep Power
    0

    Default

    Quote Originally Posted by owen View Post
    I see what you are saying, very thorough description. Though on that last point you made there about crud auto-generation does have some side effects of tedious and annoying to maintain (but thats a whole other article). So if the forms are so tedious to set up, why are MadHacker and other people using it ?
    I believe that you would have to direct that question at them to get a honest answer. I could only make assumptions. I think it boils down to what you have been exposed to, your current level of knowledge and your tastes.

    When I just started using frameworks, Codeignitor was the first one a tried. Why?
    - My knowledge of the technology was not impressive and I found it impossible to understand less use giants like Zend and symfony.
    - There were a lot of blog posts and reviews that boasted that codeigniter was the fastest framework and the easiest to use. For a while, it was like I discovered gold because i considered it a huge improvement over procedural php which I was accustomed to. However, after a while, my thirst for knowledge grew and eventually outgrew codeigniter (Fortunately, soon enough for me to abandon the codeigniter camp before a became a tainted fanboy).

    I started looking elsewhere for something that would suite my needs. I evaluated literally over a hundred frameworks. I went as far as using frameworks written in different languages (chinese/mandarin) at one point (I was very impressed with the knowledge of the foreigners) [hellp thinphp http://thinkphp.cn hello I-Framework http://ifphp.cn ]. I've rolled with they ones that claimed to be the fastest :-O http://doophp.com ... I could go on and on and on... but let us move on.

    Eventually my knowledge grew in height to a point where I was able to see eye to eye with the big boys like Zend and symfony. They were good. However, they both had what a considered to be a dealbreaker for me. They were slow. So I continued by journey down framework road. It was then that I met Yii. We connected right away. The way it was so extensible, it had speed, the code was 100% beautiful OOP. I felt right at home with it. It provides the tools that help me to develop quickly especially when i've been sleeping on a project for weeks then the client ask me to show him/her something. I just tell him I'll put it up "later tonight". I then just run a crud on the database, drop in a few GridViews, ListViews, DetailViews etc and customize the hell out of those bad boys. By morning, I still have a client and a happy one at that.

    Since then, even though I've been evaluating the new kids on the block when I'm bored, I primarily used Yii for every and anything I needed to build.

    I believe it was sometime last year that I saw a presentation made by fabien, the lead developer at symfony. I was impressed so i started watching the development of Symfony2. I'm even more impressed with it than Yii (even though I'm still rooting for Yii, they will start development of their 2.0 version soon). If you are developing large web apps especially at the enterprise level, then Symfony2 is the way to go.

    Using frameworks like Yii then looking back at codeigniter is like digging through my archives and looking back at my first php or c project (the code just make me want to puke).

    Again, you should ask those guys which other frameworks they have evaluated, what they liked and didn't like about them. What they do and do not like about codeigniter etc... to gain more insight.
    Last edited by jayrulez; Mar 7, 2011 at 11:34 AM.

  8. #18
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default

    I am more on the procedural side of programming but a friend of mine was evaluating the use of codeignitor on a project he is doing. We'll have to have a thread discussing Symphony and Zend at some point. I appreciate you comprehensive converage on the topic.

  9. #19
    Join Date
    Jun 2008
    Posts
    74
    Rep Power
    0

    Default

    Quote Originally Posted by owen View Post
    I am more on the procedural side of programming but a friend of mine was evaluating the use of codeignitor on a project he is doing. We'll have to have a thread discussing Symphony and Zend at some point. I appreciate you comprehensive converage on the topic.
    No problem. Why are you more any the procedural side of programming?

  10. #20
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default

    Quote Originally Posted by jayrulez View Post
    No problem. Why are you more any the procedural side of programming?
    I am what you call a old school programmer. I've written a few articles on the topic but programming procedurally more times than not allows me to be highly dynamic. The thought behind using something like CI would be to produce something "standard" very quickly.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •