And now that you’re aware of the topics that are covered in this group of articles, it’s time to review the concepts discussed in the last tutorial. In that part, I used a practical example to show you how to partially remove presentation logic from a particular view file, and implement it within a simple controller class. As with many other aspects related to using the Model-View-Controller pattern with CodeIgniter, making views a bit “dumber” has its pros and cons. How successful this approach can be in the end depends strongly on the structure defined for a particular application. Again, it’s fair to mention here that CI gives developers enough flexibility to implement the MVC pattern without forcing the use of a specific programming methodology. Indeed, this is one of its most appreciated characteristics. Now, returning to the previous tutorial, you’ll recall that I developed a sample PHP application. It displayed the contents of some database rows which were previously fetched from a “users” MySQL table. Moreover, these rows were retrieved by using the active record class bundled with CI. However, it’s also possible to define a model that performs all of the database-related operations, instead of directly using the database class. Thus, in the next few lines I’m going to show you how to build another web application similar to the one that you learned in the preceding article -- but this time it will incorporate a basic model class. In doing so, you’ll be able to see how to handle views by using the entire Model-View-Controller triad. Are you ready to continue learning how to parse views with CodeIgniter? Then let’s jump right in!
blog comments powered by Disqus |