correct controller php file name

10 messages Options
Embed this post
Permalink
Kexiao Liao

correct controller php file name

Reply Threaded More More options
Print post
Permalink
Is the following php file name a valid Zend Framework controller file name?

 GastricEmptyingController.php

Please note The letter E is capital E not small letter
weierophinney

Re: correct controller php file name

Reply Threaded More More options
Print post
Permalink
-- Kexiao Liao <[hidden email]> wrote
(on Wednesday, 19 December 2007, 12:27 PM -0800):
> Is the following php file name a valid Zend Framework controller file name?
>
>  GastricEmptyingController.php
>
> Please note The letter E is capital E not small letter

Yes, and you're refer to it on the URL as:

    /gastric-emptying/

or

    /gastric.emptying/

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

Re: correct controller php file name

Reply Threaded More More options
Print post
Permalink
In reply to this post by Kexiao Liao

if your are not use your own dispather but use Zend_Controller_Dispatcher_Standard (most people do), then that name is not a valid name.

check getControllerClass in Zend_Controller_Dispatcher_Standard, you will see how standard  dispatcher format class name.

regards.

Kexiao Liao wrote:
Is the following php file name a valid Zend Framework controller file name?

 GastricEmptyingController.php

Please note The letter E is capital E not small letter
Kexiao Liao

Re: correct controller php file name

Reply Threaded More More options
Print post
Permalink
Please give me the link to see the detail about the standard dispatcher format class name.

ctx2002 wrote:
if your are not use your own dispather but use Zend_Controller_Dispatcher_Standard (most people do), then that name is not a valid name.

check getControllerClass in Zend_Controller_Dispatcher_Standard, you will see how standard  dispatcher format class name.

regards.

Kexiao Liao wrote:
Is the following php file name a valid Zend Framework controller file name?

 GastricEmptyingController.php

Please note The letter E is capital E not small letter
Kexiao Liao

Re: correct controller php file name

Reply Threaded More More options
Print post
Permalink
In reply to this post by weierophinney
Why we need to use - or . between gastric and emptying? Please give more explanations?

Matthew Weier O'Phinney-3 wrote:
-- Kexiao Liao <liaok@ccf.org> wrote
(on Wednesday, 19 December 2007, 12:27 PM -0800):
> Is the following php file name a valid Zend Framework controller file name?
>
>  GastricEmptyingController.php
>
> Please note The letter E is capital E not small letter

Yes, and you're refer to it on the URL as:

    /gastric-emptying/

or

    /gastric.emptying/

--
Matthew Weier O'Phinney
PHP Developer            | matthew@zend.com
Zend - The PHP Company   | http://www.zend.com/
weierophinney

Re: correct controller php file name

Reply Threaded More More options
Print post
Permalink
In reply to this post by ctx2002
-- ctx2002 <[hidden email]> wrote
(on Wednesday, 19 December 2007, 12:56 PM -0800):
> if your are not use your own dispather but use
> Zend_Controller_Dispatcher_Standard (most people do), then that name is not
> a valid name.
>
> check getControllerClass in Zend_Controller_Dispatcher_Standard, you will
> see how standard  dispatcher format class name.

Actually, I've already replied to the OP that it *IS* a valid name.
However, you can't use camelCasing on the URL, and instead need to
separate the words with either a '.' or a '-'; this is true for action
names as well.

So, GastricEmptyingController::stomachPumpAction() would be referred to
on the URL as:

    /gastric-emptying/stomach-pump

or

    /gastric.emptying/stomach.pump


> Kexiao  Liao wrote:
> >
> > Is the following php file name a valid Zend Framework controller file
> > name?
> >
> >  GastricEmptyingController.php
> >
> > Please note The letter E is capital E not small letter

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

Re: correct controller php file name

Reply Threaded More More options
Print post
Permalink
In reply to this post by Kexiao Liao
it in your zend source code package, i think your already have that in your computer, otherwise  your site not going to run.



Kexiao Liao wrote:
Please give me the link to see the detail about the standard dispatcher format class name.

ctx2002 wrote:
if your are not use your own dispather but use Zend_Controller_Dispatcher_Standard (most people do), then that name is not a valid name.

check getControllerClass in Zend_Controller_Dispatcher_Standard, you will see how standard  dispatcher format class name.

regards.

Kexiao Liao wrote:
Is the following php file name a valid Zend Framework controller file name?

 GastricEmptyingController.php

Please note The letter E is capital E not small letter
weierophinney

Re: correct controller php file name

Reply Threaded More More options
Print post
Permalink
In reply to this post by Kexiao Liao
-- Kexiao Liao <[hidden email]> wrote
(on Wednesday, 19 December 2007, 01:04 PM -0800):
> Why we need to use - or . between gastric and emptying? Please give more
> explanations?

In order to better match incoming requests, the router normalizes the
path elements to lowercase. If there is no separator between the words,
then they become 'gastricemptying', and the dispatcher then has no idea
that these are supposed to be two separate words and CamelCased. Adding
a word separator allows us to match on that and replace it with a space,
and then pass the result to ucwords -- giving us the CamelCasing
desired.

The conversion to lowercase is because humans are remarkably
unpredictable in how they type URLs, and could type them /ALLUPPER/CASE
or /alllower/case; to allow these to resolve regardless, we do the
normalization.

> Matthew Weier O'Phinney-3 wrote:
> >
> > -- Kexiao Liao <[hidden email]> wrote
> > (on Wednesday, 19 December 2007, 12:27 PM -0800):
> >> Is the following php file name a valid Zend Framework controller file
> >> name?
> >>
> >>  GastricEmptyingController.php
> >>
> >> Please note The letter E is capital E not small letter
> >
> > Yes, and you're refer to it on the URL as:
> >
> >     /gastric-emptying/
> >
> > or
> >
> >     /gastric.emptying/
> >
> > --
> > Matthew Weier O'Phinney
> > PHP Developer            | [hidden email]
> > Zend - The PHP Company   | http://www.zend.com/
> >
> >
>
> --
> View this message in context: http://www.nabble.com/correct-controller-php-file-name-tp14424663s16154p14425363.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>

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

Re: correct controller php file name

Reply Threaded More More options
Print post
Permalink
In reply to this post by Kexiao Liao
-- Kexiao Liao <[hidden email]> wrote
(on Wednesday, 19 December 2007, 01:01 PM -0800):
>
> Please give me the link to see the detail about the standard dispatcher
> format class name.

See:

    http://framework.zend.com/manual/en/zend.controller.action.html

section 7.7.5.2 has some information on it. I also added more
information on this in the Zend_Controller Basics chapter in current
SVN.

> ctx2002 wrote:
> > if your are not use your own dispather but use
> > Zend_Controller_Dispatcher_Standard (most people do), then that name is
> > not a valid name.
> >
> > check getControllerClass in Zend_Controller_Dispatcher_Standard, you will
> > see how standard  dispatcher format class name.
> >
> > regards.
> >
> >
> > Kexiao  Liao wrote:
> > >
> > > Is the following php file name a valid Zend Framework controller file
> > > name?
> > >
> > >  GastricEmptyingController.php
> > >
> > > Please note The letter E is capital E not small letter

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

Re: correct controller php file name

Reply Threaded More More options
Print post
Permalink
In reply to this post by weierophinney
i am also want  to know why camelCasing is not allowed in URL?

regards.


Matthew Weier O'Phinney-3 wrote:
-- ctx2002 <ctx2002@gmail.com> wrote
(on Wednesday, 19 December 2007, 12:56 PM -0800):
> if your are not use your own dispather but use
> Zend_Controller_Dispatcher_Standard (most people do), then that name is not
> a valid name.
>
> check getControllerClass in Zend_Controller_Dispatcher_Standard, you will
> see how standard  dispatcher format class name.

Actually, I've already replied to the OP that it *IS* a valid name.
However, you can't use camelCasing on the URL, and instead need to
separate the words with either a '.' or a '-'; this is true for action
names as well.

So, GastricEmptyingController::stomachPumpAction() would be referred to
on the URL as:

    /gastric-emptying/stomach-pump

or

    /gastric.emptying/stomach.pump


> Kexiao  Liao wrote:
> >
> > Is the following php file name a valid Zend Framework controller file
> > name?
> >
> >  GastricEmptyingController.php
> >
> > Please note The letter E is capital E not small letter

--
Matthew Weier O'Phinney
PHP Developer            | matthew@zend.com
Zend - The PHP Company   | http://www.zend.com/