List Info

Thread: Re: Proposal finished Network




Re: Proposal finished Network
user name
2007-03-02 12:02:04
Le 2 mars 07 à 18:32, till a écrit :

>
> Not that anyone cares about what I think , but I
feel like this
> would make a great addition. If people didn't like the
name, they
> should not have voted +1 on it? But they did, so I
guess it passed.
>
> The reason why some proposed renaming the package is
because of how
> things are already "called" in other (MVC)
frameworks.
> Take the Zend Framework as an example, it's referenced
with
> Zend_Controller_Front::getRouter and the like. So
people would
> probably search PEAR for "router" instead of
"mapper". By the way,
> Rails does the same. I *think* Symfony is also
following this model.
>
> What's your concern with renaming it?

In Rails and ZF and others, the router object is indeed
routing: it  
takes the url and automatically deduces a 'controller' and
an  
'action', even if they were not defined in the url, then
perform the  
action within the controller. While this is handy if you
have a  
framework that was made to work this way, it's not very
flexible  
because there is a lot more you can do with an url than just
routing  
like this. Furthermore, in such frameworks, AFAIK (but I
might be  
wrong), you always end up with urls like these: http://example.com/ 
controller/action/arguments. This is also a limitation IMO.

Net_URL_Mapper is only mapping the url to a defined set of
rules and  
returns results when the url matches a rule. It is possible
to define  
rules for the configuration above. But you can also go your
own way  
and have modules, sub modules, extensions, plugins,
versions, action  
objects, whatever you need. It's more generic. It can be
used to  
validate and generate urls, even without controllers nor
actions.  
It's not tied to a framework.

In the end, users will be able to find the router they are
after in  
PEAR if it is documented to be found with such keywords I
think. My  
concern is that the term routing is limited and can lead
users to  
think "Damn, yet another controller/action router"
while it is not.

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


Re: Proposal finished Network
user name
2007-03-02 12:11:16
On 3/2/07, Bertrand Mansion <golgotemamasam.com> wrote:
> In the end, users will be able to find the router they
are after in
> PEAR if it is documented to be found with such keywords
I think. My
> concern is that the term routing is limited and can
lead users to
> think "Damn, yet another controller/action
router" while it is not.

Cool, well. I sure see your point. 

Cheerio,
Till

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


Re: Proposal finished Network
user name
2007-03-02 12:18:47
On Mar 2, 2007, at 1:02 PM, Bertrand Mansion wrote:
> In Rails and ZF and others, the router object is indeed
routing: it  
> takes the url and automatically deduces a 'controller'
and an  
> 'action', even if they were not defined in the url,
then perform  
> the action within the controller. While this is handy
if you have a  
> framework that was made to work this way, it's not very
flexible  
> because there is a lot more you can do with an url than
just  
> routing like this. Furthermore, in such frameworks,
AFAIK (but I  
> might be wrong), you always end up with urls like
these: http:// 
> example.com/controller/action/arguments. This is also a
limitation  
> IMO.

I've not used ZF, but that's not the case in rails. The
default route is

map.connect ':controller/:action/:id'

but that can be removed or replaced with a wide variety of
other  
options. eg. One I often use in location-driven sites is:

map.connect 'zip/:id' , :controller => 'locations',
:action => 'zip'

One explanation can be found at:

http://www.pinupgeek.com/2006/5/24/rails-routing-dem
ystified

and Jamis Buck has some good write ups of how it works under
the  
hood, such as:

http://weblog.jamisbuck.org/2006/10/2/unde
r-the-hood-rails-routing-dsl

James.




-- 
James Stewart
Play: http://james.ant
hropiccollective.org
Work: http://jystewart.net/pr
ocess/



[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )