Wednesday, October 9, 2013

Re: Identical controller names

Naming the files with the same name wouldn't be so difficult ...  one of the files is contained in a plugin. My thinking was that within the app itself I would have controller and plugin.controller and although they would share the same name they are referenced differently and perhaps it wouldn't be so much of an issue. To be honest I wasn't really sure how it would work out but I was curious nonetheless. 


On Thu, Oct 10, 2013 at 1:08 AM, Борислав Събев <borislavsabev@gmail.com> wrote:
It would not really affect it in a good way. :D
Cake is convention based and this will be your first drawback.
Moreover how did you plan on naming the files with the same name?
It is possible on Unix/Linux systems but it is a bad practice - very bad. :)
If they serve similar functionality they are most probably just different user roles? :D
You could have different controllers for them, like: Users and Managers.
This is really an abstract OOP decision but in the context of Cake it'd not do much good.

On Thursday, 10 October 2013 08:02:16 UTC+3, CrotchFrog wrote:
I thought better of the idea. Seems pointless to have identical names when there are so many others to choose from :) I suppose I was more curious about how it would effect the app moreso than actually creating the controllers. 

Thanks for the reply :)


On Wed, Oct 9, 2013 at 11:40 PM, Reuben <reuben...@gmail.com> wrote:
Without namespaces, I think you might end up with a class name clash, since you would have two UsersController classes trying to occupy the global name space.

Regards
Reuben Helms

On Thursday, 10 October 2013 03:29:49 UTC+10, CrotchFrog wrote:
Would it be considered bad practice to have two identical controller names? For example I was wondering about having a 'UsersController'  to keep my logic separate from 'UsersController' in one of my plugins, or would it be best to just name one or the other differently? I can foresee one or two "issues" going this route but am I missing a bigger picture? 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to a topic in the Google Groups "CakePHP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/7SvbTm2_MX4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to a topic in the Google Groups "CakePHP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/7SvbTm2_MX4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: