Friday, February 3, 2012

Re: Different frontend and backend controllers

Sounds like a good set up, I don't suppose you have an open source copy of the admin system you use for 1.x? I wouldn't mind trying to implement it into 2.x (but 1.3 may work)

Cheers :)

On 3 February 2012 12:11, Thaissa Mendes <thaissa.mendes@gmail.com> wrote:
Yes, using an AdminController can prevent duplicate code. My backend
controllers would almost always have at least "index", "add", "edit"
and "delete" methods. Those methods, created on AdminController, let
me have on my backend controllers only any extra methods I would need.
Creating add/edit/delete/index methods over and over seems to me a
waste of time.

Currently, using my 1.x modification, when I'm creating a backend
module, I just create the table, create an almost empty backend
controller, and that's it. Of course there are cases which I need some
extra methods (such as "activate" or "show"), but the default actions
are already working.

I also created "beforeDelete", "afterSave" and some other methods to
be able to set anything before the AdminController saves/deletes
something, or after saving/deleting.

Anyway, after some years using that way, I really prefer to change
Cake's core again, or keep using 1.x, than stop using that way.


On Fri, Feb 3, 2012 at 5:03 AM, Stephen <stephen@ninjacodermonkey.co.uk> wrote:
> I always assumed it was much better to use a prefix than to separate your
> controllers or possibly duplicate code?
>
> Using the AdminController extension (which I assume extends AppController?),
> can this prevent duplicate code and what are the benefits if you don't mind
> me asking?
>
> Kind Regards
>  Stephen
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php



--
Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: