[wp-hackers] The problem with WP_Rewrite <<< RE: Options for Controller - Views

Otto otto at ottodestruct.com
Fri Nov 27 19:38:50 UTC 2009

On Fri, Nov 27, 2009 at 8:13 AM, Jacob Santos <wordpress at santosj.name> wrote:
> Yeah, I'm talking about the controller as a whole, which usually includes
> the URI parsing, the Router, and the classes or in WordPress's case,
> functions. I'm also talking about the views, because the controller that is
> called loads the specific view.

In that sense, WordPress has no controller, as you understand it. It
doesn't really fit the MVC mold. Note: I think that's a good thing.

> Actually, to clear up any confusion, the
> WordPress views, i.e. the templates and their files, will not change. The
> only thing that will change is that there will be functions or classes that
> loads the view, instead of a if...elseif block.

Fair enough, but I don't see any benefit to doing this. What will you
be better able to do with a template-redirect.php changed into some
class system that you cannot do right now?

Also, again, I must state that this subsystem (file) has zero to do
with URLs, parsing, rewriting, the query... So how do those fit into
your idea?

> I couldn't care if it is going to
> be acceptable for WordPress, I'm doing it for me and if anyone wants to see
> it in WordPress, then so be it.

I just don't want you to waste your time and then to become
disillusioned if others dislike it. I'd prefer to understand what it
is that you want to do before you go and do it. I'd like to help make
improvements to the existing code, if you can tell me where you think
there are failings.

> I'm asking if in anyone
> opinion if I should extend the current or replace it.

I can't give you my opinion until I understand what you're talking about.

I think the existing system is fine, personally. Some better
documentation, perhaps, but I can't think of anything that is wrong
with it in particular.

> Also, the whole thing about the parameters. That is already possible with
> many controller implementations. Only the most rigid don't allow you to do
> that with the URL string. However, one thing, if you wanted /tag/whatever to
> set $tag = whatever, then do the same thing as setting certain parts to
> parameters for a controller. So you would still send it to a controller, it
> just wouldn't be the "tag" controller class or function. Or I mean, it could
> be the tag controller to save time and automatically call the tag controller
> class which sets the $tag parameter to "whatever".

I understand this, but I found it difficult and confusing in every
rigid-MVC style system I've tried, which is why I pretty much hate MVC
in general. It's rigid and inflexible in 99% of the implementations of
it. It's a bad way to write web-code. IMO, of course.

Sent from Memphis, Tennessee, United States

More information about the wp-hackers mailing list