Introduction Now that you know what to expect from this article series, it’s time to recapitulate briefly the topics that were discussed in the last installment. In that particular tutorial I demonstrated how to build a simple MySQL-driven application by using a combination of the “$this->load->vars()” method and nested views. This approach allowed me to generate independently different sections of a front page, whose main area was populated with data fetched from a sample “users” MySQL table. Admittedly, including views within other views is a useful method that permits you to use certain parts of a web document across multiple pages of a web site; but the most interesting aspect of it is that it can be implemented in different ways. Speaking more specifically, it’s possible to feed the “$this->load->view()” method of CI a third Boolean parameter, to return the contents of a view to calling code after the view has been parsed. This is a handy variation of the method demonstrated in the previous article, and in this tutorial I’ll be taking a close look at it, so you can grasp its underlying logic. Now, it’s time to get things rolling on and see how to return strings from views with CodeIgniter. Let’s do it!
blog comments powered by Disqus |