Blog Journeys of a Lifelong Learner
Subscribe
A PHP Debugging Tip March 16, 2010
I spent a number of hours yesterday working on a PHP programming project.
One of the final challenges I faced was an issue involving an array of objects passed to a view by a controller (in an MVC architecture), where the view was not properly rendering the required output.
I eventually discovered the problem: I used a require_once function where I should have used a standard require or include function.
The faulty fragment:
require_once 'fragment/some_template.tpl.php';
The rectified fragment:
require 'fragment/some_template.tpl.php';
Simple errors are easily made in programming, but it is the process of tackling new software development challenges that produces increased technical competence.