Implicit Evaluation with PHP

7 March 2006

Simple Commandline Debugging Fragment

One advantage the page=verb Model 1 style of coding has is that its much easier to debug. Want to know if a page works? Just access it.

So all of the sudden in Model 2, you run php controller.php or whatever. Great. Now what? How to you check if it can correctly spit out the filterlist action on user names beginning with F?

Turns out to be a two-liner.

/* populate REQUEST with key value pairs from command line */
for ($x = 2; $x + 1

Now you can run php controller.php — action FilterList filter f and $_REQUEST will look like array (”action” => “FilterList”, “filter” => “f”);

No Comments currently posted.

Post a comment on this entry: