Welcome Guest, Not a member yet? Register   Sign In
Some basic question abt codeingniter and any framework
#1

[eluser]Tanvir[/eluser]
Hello, I am completely NEW to codeingniter or any framework. I have some basic questions-

1. What is the difference between class reference and helper reference and plugin ?

2. Where can I get and how to use codeigniter plugins ?

3. Why use some classes in codeigniter when PHP itself has ways of handling it, e.g.date, calendar,file uploading etc.

4. If I want to use any third party web template in codeigniter, How can I use that ?

5. Dont u think using MVC framework requires some extra coding overhead, now I need a separate file for displaying, for controlling and for db modeling for the same webpage.
#2

[eluser]jblack199[/eluser]
1. helpers is a simple class of function used to 'help' you do repeated tasks over and over. libraries are similar in that respect as well. models are more generally used on a per-page basis to put all your code in one place ie: login_user() function or other functions for the different pages.

2. the forums have helpers/libraries on it, but to my knowledge there isnt a master list of them anywhere.

3. while you can do things in php, using the classes keeps you with the OOP programming, and has all the data handling already programmed which means less time programming and bug tracking.

4. third party web templates can be used easy enough, since your view files have your html in it. there are ways of using a header.php, footer.php and a template.php to use the same header/footer for every page in a site.

5. MVC in essence does take 'extra coding' because of the extra files but in the long run makes your application easier to read, easier to edit and most importantly easier to fix in the end. It also makes the pages faster to load as instead of having an index.php that is say 1meg (rare but it happens), you'd have multiple files that are about 10kb in size making them run faster in the browser causing your site to load quicker.

all and all, i've used nothing to develop web applications i've also used the smarty template engine and i am not learning and using CI. While smarty is easier to learn and it keeps all php out of your html, its also bloated and makes web apps run slower and it actually uses more of your time programming and is harder to do your bug tracking. So CI or any MVC for that matter, is there to make your job as a programmer much smoother and easier to get from beginning product to finished application.
#3

[eluser]boltsabre[/eluser]
Going on from what jblack199 said in regards to question 5:

Initially, as you learn CI (or any other framework), it may seem a little, ummm, retarded at first. But once you get the hang of it, it really is so much simpler, quicker, and smaller than coding vanilla php/html.

I've built a fully functioning 'user login/registration' system (including register, send confirmation email, activate account, edit account, delete account, resend password reset, edit password) with about 200 lines of model stuff and 500 lines of controller stuff (including white space, which I like lots of for readability issues). Try doing that with vanilla PHP, not a chance!

And it really does help to keep things modular and separated, which is excellent for both bug tracking/fixing, and expansion of functionality at a later date.




Theme © iAndrew 2016 - Forum software by © MyBB