Actually, in 3.x this is exactly what is going to happen. Admin controllers will live in an Controller\Admin namespace
/thomas On 22 Aug 2014, at 10:39, Stephen S <[email protected]> wrote: > Hey Paul > > I can understand your reasoning of wanting to bake controllers in an admin > subfolder but I think that this is just going to fight against Cake and make > life more difficult for you. > > You can set up an admin prefix which means when you access > www.site.com/admin/users/index it will search for the default > UsersController.php file and the admin_index() method within it. > http://book.cakephp.org/2.0/en/development/routing.html#prefix-routing > > /app/Controllers/UsersController.php > /app/Views/Users/admin_index.ctp > > If you'd like to bake these admin methods and views when you bake your > regular methods you can do this by altering the bake templates (See > http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html#modify-default-html-produced-by-baked-templates) > > > > > > > On 21 August 2014 00:35, Paul Drage <[email protected]> wrote: > Hi there! > > I've a background from CodeIgniter and am trying out CakePHP. > So far I'm pretty impressed with how Cake can be scaled and how quick it is > to get up and running - even on a strange remote DB setup things seem to be > lightning fast. > > I have created tables in a database, something like 27-28 tables with > interlinking _id fields, I have run # cake bake models / controllers / views > - and looked at the resulting framework in a web browser, all of the links > seem to work and it's quick to add data - GREAT! > > Now - Rather than creating 27-28 models and controllers and views manually > cake has generated it all for me and put it into the relevant folders like > /app/views > This is a bit hard to explain but I would of liked to of baked my CRUD stuff > into a sub folder within each type, so for example: > > app/controllers/ADMIN/___all_controllers baked > app/models/ADMIN/__ > app/views/ADMIN/__ > > Then I would like to implement ACL/Auth rules to lock down all of the > controllers that were baked into the admin folder/section based on something > like admin_level (int) in db table. > > This would then facilitate me in being able to use the root to build out the > 'public' facing website which will sit on top of everything else - right now > (i'm not sure if this is even possible?!) it's just a mess.. my views folder > has probably 40-50 sub-folders with files in each - there isn't a nice folder > structure, as soon as i come to add more controllers for the front-end public > facing data and website i fear it will become unmanagable. > > Please could you provide any assistance? I've looked at routing - I > understand the concept, but I don't think that will solve the file management > aspect here. > If I am unable to solve the file management side, i.e all files must be in > subfolders within /views/ then perhaps you could suggest a way that I may be > able to continue using the awesome function 'cake bake' to generate the CRUD > views/models/controllers but with a view to me being able to specify that > everything baked is to be 'ADMIN' functions - i have no problem hand coding > the rest of the controllers and models for the public site - but the sheer > amount of tables dictates that I'd be crazy to try and build every one of > them by hand when cake bake is doing a great job for me already? > > I've looked through the blog tutorial and so on but I've been unable to find > any specific answers to my queries - I have been working with PHP since 2004 > so have plenty of hands on experience but Cake might still be a little alien! > > Thanks for any ideas or input you may have, it will be truly appreciated > (right now the comfortable thing to do would be to go back to CodeIgniter > which I'm trying my best to resist!) > Cheers > Paul > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/d/optout. > > > > -- > Kind Regards > Stephen Speakman > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/d/optout. -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
