After being interested in it for a while, I’ve started experimenting with Kohana (v 3.2). When I started working with the ORM-based user authentication it ships with, I immediately ran into some trouble. Searches turned up scant information, so I’m posting this to help people who run into the same problem.Continue reading
I just released a new ExpressionEngine add-on called PathFinder. It allows you to configure ExpressionEngine to automatically perform an HTTP 301 redirect when the URL slug (url_title) for an entry is changed.Continue reading
In general I’ve been pretty happy with the array implementation in PHP, finding them pretty versatile, flexible, and easy to use. I like that you can just mix integer and string keys, associative arrays are ordered, writing to a nonexistent nested array auto-vivifies it, reading a nonexistent key / index just evaluates to NULL and doesn’t generate an error, etc. However, I do see room for improvement.
(If you want to experiment with code examples in this post, see the reference code.)
The subject of this article is that for a long time I’ve wished for built-in functionality in PHP for dynamically accessing array elements at arbitrary nesting level. I’m talking about what are called multi-dimensional [possibly associative] arrays in PHP, and arrays / hashes / maps in other languages. In any case, I’m talking about tree structures / hierarchies built by nesting those data types. For example, consider this array:Continue reading
For a long time I’ve wished PHP had a built-in function for dynamically evaluating a string variable as a double-quoted string or HEREDOC, to perform variable interpolation (aka expansion) on-the-fly. It’s frequently useful to store a template in a string and then interpolate data into it later, pass the template to a function, etc. Example:Continue reading
Say you have a website that you want to run partly with WordPress (say a Blog section) and partly without WordPress, using the same design. I’ll demonstrate a technique for using the same layout template(s) for WordPress content and other content without duplicating code, and in the process also demonstrate that it’s not necessary to use the header & footer include scheme that WordPress advocates.Continue reading