I’m not sure why I haven’t posted this yet. The following code block is (one way) of simulating named parameters in PHP for class method calls. It utilizes PHP’s magic method __call and takes advantage of PHP 5’s Reflection API for determining default values of parameters not passed.
Parameters can be passed two ways:
$obj->method(array(‘key’ [...]
This post is simply stating the obvious. Sometimes even obvious things, in the wee hours of the morning, aren’t so.
When you specify parameters in your URLconf like:
urlpatterns = patterns(”,
url(r’^mark/(?P<id>\d+)/(?P<complete>\d+)/$’, views.mark, name=’mark’),
)
Keep in mind that each captured argument is a Python string. Even if the regex only captures integers – [...]
21 Apr
by: Matt in Development, PHP, Ruby on Rails
tags: 37signals, php, Ruby on Rails
What exactly are they using it for? Front-end?
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.