On 12/09/2007, Jim Hu jimhu@tamu.edu wrote:
I agree that the CategoryPage class could use some hooks. In the absence of hooks, you can also make your own CategoryPage class that exends CategoryPage and overrides (there's a technical term for this, but I forget what it is) just the methods you want to hook into.
Overloading. But wouldn't that require rewriting the code that calls CategoryPage to make it call the new class? If you're changing the core code like that, you may as well just add the code directly to CategoryPage.php and not worry about hooks.
When I did this for SplitCategoryPage.php, it worked, except that I never did figure out how to get CategoryPage.php to autoload the Article class (I assume this means I'm doing something incorrectly). I had to add require_once('Article.php') to CategoryPage.php. Not surprisingly, I forget about this and it breaks every time I upgrade.
If it extends Article (even indirectly, via CategoryPage), it should have all the methods and attributes from the Article class already... that's the whole point of inheritance...