I don't fully get why we need a formatted name anyway. Why not just normalize the token from the url in a consistent way and call that method in a case sensitive way -- when trying a noroute strategy, reflect the controller, look for a strtolower-case'd name that matches call it and throw a notice/warning about the performance impact.

Would make more sense to me -- am I missing something..

Kevin
----- Original Message ----- From: "Matthew Weier O'Phinney" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, January 05, 2007 10:22 AM
Subject: Re: [fw-general] CamelCase controller names


-- kosan <[EMAIL PROTECTED]> wrote
(on Friday, 05 January 2007, 09:07 AM -0800):
The controller names are supposed to be able to be camel case and we have
always been able to name them as such. However after checking out the 0.6.0
framework i decided to check out the module support so i could put my
controllers into subdirectories and it appears the came case is no longer
supported. Does anyone know if this is by design or if it's a bug that needs
to be reported someplace?

Just as an example to illustrate what i mean, i have a controller called
PackageSelectController.php and now with module support i put it into an
Order module so using the rewrite router i now reference it as
BASE_URL/Order/PackageSelect/  however debugging this i can see in the
dispatcher it takes the controller name and passes it to strtolower() so we
get "packageselect" then it calls ucfirst() on that so we end up with
"Packageselect" as the name of the controller which won't exist.

So my main question again is, is this by design and we shouldn't be using
came case names any more for controllers, or is this a bug that needs to get
reported?

This has been the case all along. For instance, I originally wrote an
XmlRpcController in 0.1.0, but had to modify this to read
XmlrpcController. The logic in the dispatcher class's _formatName()
method has changed little since then, and the changes so far have only
been to accomodate the underscore character.

--
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/

Reply via email to