[wp-hackers] Options for Controller - Views

Otto otto at ottodestruct.com
Mon Nov 23 23:17:13 UTC 2009

I still don't understand the problem, exactly. It seems perfectly
clear and separated to me. I think you're conflating what each piece
does and trying to make things do something they were never designed
to do.

It's really quite simple.

URL comes in, gets grabbed.
WP_Rewrite parses it, sets up query_vars.
WP_Query is loaded and uses query_vars to get database data. Also sets
some internal flags.
template-loader.php is loaded last, and uses those flags to determine
the correct view.

Where is the disconnect between these? WP_Rewrite is relatively easy
to adjust and change if you know regexp. WP_Query is less easy to
change, but often it's unnecessary to mess with if you're loading
custom data. And the template-loader couldn't really be any more
simple, though it probably could be more efficient.

Let's try another approach: What is it that you want to do that you're
finding very difficult to do? Because I think you're simply
doing-it-wrong, somehow. If you want to "replace" WordPress' control,
than that's really not at all difficult to do.

Sent from Memphis, TN, United States

On Fri, Nov 20, 2009 at 4:02 PM, Jacob Santos <wordpress at santosj.name> wrote:
> Okay, so looking at the issue, it seems I had thought that the WP_Query was
> the router, but really it is WP_Rewrite. Also, it seems that too much is
> really just tied to WordPress itself and requires work to extend with other
> uses. In my opinion, WP_Rewrite and WP_Query can exist, but new code can be
> created for WordPress that is more generic that the two classes can then
> use.
> In this way, the Router, URI, and Controller can be separated in to their
> own easily identified components. The Views can also be changed to not be
> based off of the template loader file.
> I believe the problem is that too much of the code is affecting WordPress
> and it is difficult to see how to work within the parameters to add and
> change. In this way the entire set up is really a hack provided to allow for
> other people to extend WordPress but not really take it and replace
> WordPress cleanly.
> Part of the issue is lack of documentation and well, if no one is going to
> step up that knows it well enough (I can't get the code to work that is on
> the Codex) then really, when I write the new code, I'll be sure to write out
> a detailed explanation.
> You know if someone wants to help, I can create a ticket and apply the
> patches when I have something. Or if someone wants to take it in a new
> direction, I think, if there are multiple implementations then the best one
> can be looked at. (Also I will probably "steal" it for my own project.)
> Jacob Santos
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list