Issues

ZF-2995: camelCase example is MixedCase instead of camelCase

Description

In the note titled CamelCasedNamingConventions at http://framework.zend.com/manual/en/… the discussion is talking about camelCased controller and action names, but the controller name is MixedCased instead of camelCased.

So, change: FooBarController::bazBatAction() to fooBarController::bazBatAction()

Although it's a minor change, it is the topic of the note...

Comments

I don't see this problem on the page supplied. Maybe it's been fixed already?

nope, the problem is still there. the line is:

FooBarController::bazBatAction(), you'd refer to it on the url as /foo-

and it should be:

fooBarController::bazBatAction(), you'd refer to it on the url as /foo-

note the lower case for the first character of the sentence (camelCase for controller name).

Ah I see what you mean.

Although from my testing I've found that you need the filename to be FooBarController.php and the class name can be either.

Please evaluate and categorize as necessary.

James,

I appreciate your thoroughness in testing the documentation change! It's an interesting point that you raise.

In addition, there are coding standards to consider. The naming convention for classes is at: http://framework.zend.com/manual/en/… but it does not mention camelCase vs MixedCase. This coding standard is for zend framework code, but since zend framework code will likely use controllers and actions, this coding standard will likey apply to controller naming also.

After reading the coding standard for a 2nd time ( http://framework.zend.com/manual/en/… ), I noticed the paragraph:

If a class name is comprised of more than one word, the first letter of each new word must be capitalized. Successive capitalized letters are not allowed, e.g. a class "Zend_PDF" is not allowed while "Zend_Pdf" is acceptable.

and since all ZF code is under the Zend directory, then all subsequent words will be capitalized which implies MixedCase class names.

Also, filenames seem to follow the class names from http://framework.zend.com/manual/en/… :

File names must follow the mapping to class names described above.

Does this mean the issue can now be closed?

Thanks,

This issue is still unresolved and should remain open, in my opinion.

The issue is: should the controller class (and filename) be camelCase or MixedCase? And the answer to this should be in the docs (probably in that note titled CamelCasedNamingConventions ) In the note, the controller name should be made consistent in both the description and the example given.

Any progress on this issue? The issue is really about recommending the naming convention for controller classes and files and putting that recommendation in the docs (or correcting the docs so they reflect that naming convention).

This post is the current recommendation: http://nabble.com/Re%3A-Naming-Recommendation-for-… Is that still the recommendation? Are both camelCase and MixedCase ok and supported in the future? Better to figure this out and tell ZF users than to force each user to spend time figuring out for themselves.

Dennis -- this is not a major issue. Most developers figure it out from the examples, and don't know the difference between MixedCase and camelCase and assume they are the same thing. At best, this is a minor documentation issue.

Additionally, we publish documentation only with new releases, so even if I get it into svn this minute, it will not be on the site for several weeks. Please have patience.

Scheduling for next mini release.

Resolved in trunk

Changing to comply with new IT coventions for components.