Learn Codeigniter PHP Framework

Programming for Search Engines 101. An area for avid PHP and .NET developers to chat about Programming techniques and how to make better use of search engines.

Moderator: Moderators

Learn Codeigniter PHP Framework

Postby unni » Mon Apr 19, 2010 4:38 am

I would like to start a series of classes through our forum about codeigniter, with all discussion about codeigniter through our wyselabs forum .


So let' s start enjoying Codeigniter PHP

Before starting to learn about PHP framework, let's learn MVC architecture and it's usage..
unni
 

Re: Learn Codeigniter PHP Framework

Postby jay » Wed Apr 28, 2010 7:12 am

Great Unnikrishnan. “Teaching is the greatest act of optimism” - Colleen Wilcox

Hope we'll soon start learning !
Jay M
Write Less, Do More
jay
 
Posts: 475
Joined: Wed Nov 22, 2006 12:05 am
Location: Cochin, India.

Re: Learn Codeigniter: Series 1

Postby unni » Thu Apr 29, 2010 1:45 am

Hi, I have stopped my last post on the fly to learn CI is by saying about to begin MVC architechture study,

So, What is MVC or Non MVC Web developement?

Non MVC scripts looks as the follwing..
<html>
<?php PHP code ?>
<body>
<?php PHP code integrated ?>
[html code] <?php php code ?> [html code ends]
</body>
</html>
And
MVC basically means that the PHP and HTML are separated. The main aim of the MVC architecture is to separate the business logic part and application data from the presentation data to the user.

I will come soon with a series about the Reasons and why we should use the MVC design pattern ?

More about MVC with the help of a diagram

What is Model : The Model represents your business logic . for eg : The model classes will contain functions that help you retrieve, insert, update information in your database, Also the main backbone logics were integrated inside the model.

What is View: The View is the information that is being presented to a user. A View will normally be a web page, but in CodeIgniter, a view can also be a page fragment like a header or footer etc. ( can be invoked as required by the user ). For eg: The view will be different if
user request from normal pc or from a mobile and other devices.

What is Controller : The Controller serves as an intermediary between the Model and the View, and any other resources needed to process the HTTP request and generate a web page. More precisely Controller mainly handiles all validations and website work flow decision making.

Note : In CodeIgniter Framework, it has a fairly loose approach to MVC, bcoz it is not forces to use Models. If you don't need the built in separation, or find that maintaining models requires more complexity, you can ignore them and build your application minimally using Controllers and Views.

From the given Figure: can see Controller handling each and every request from user/browser and send it to Model for data processing and model again communicate back with the result to the Controller, finally the Controller rendering the results into a View and the view should be loaded for the user as a results of his request.

Guyz...hope you are happy with the session ....for any doubts you can contact me..
I will come up with the next one very soon...
Attachments
MVC.JPG
MVC web page work flow from server to client
MVC.JPG (18.37 KiB) Viewed 7040 times
unni
 

Re: Learn Codeigniter PHP Framework

Postby douglas » Thu Apr 29, 2010 5:53 am

Great home work and sincere dedication. The person who shares grows more.

I have little doubt about the role of Model [M] in MVC that you explained.
douglas
 
Posts: 282
Joined: Fri Feb 20, 2009 3:56 am


Return to Programming

Who is online

Users browsing this forum: No registered users and 3 guests