I can tell you from experience that you will NOT experience any
significant slowdown. I did just this for a CMS I made with CakePHP
(I'm in the middle of writing a blog post about the process).
Basically, I had a core library with "cms_" prefixed versions of my
controllers and models - so CmsUsersController, CmsUser, etc. (just
like you're doing).
I even have shared versions of AppController, AppModel, etc., named
CmsAppController, CmsAppModel, and so on. The App::import for the
local versions of AppController etc. is a little more involved, but
still straightforward:
App::import('File', 'CmsAppController', true, array
(CMS_CORE_INCLUDE_PATH), 'cms_app_controller.php');
Class AppController extends CmsAppController {}
Views, on the other hand, don't need to have any kind of prefix. As
long as you have the shared view path in your $viewPaths array, Cake
will first look in your local application's view directory, and then,
if it can't find a view file, the shared path. For example, if you're
working with users/login.ctp and you don't have a version of that file
in a location application, as long as it's in the shared view path
then it'll load just fine. If you do have a version of users/login.ctp
for a particular application, it'll just load that instead.
Like I said, I'm writing some blog posts about it so that I can share
my learning experience (and it was a HUGE learning experience) with
others. But I'd say you're on the right track..
On Aug 11, 4:09 pm, Jeebs24 <[email protected]> wrote:
> Trying to have flexibility with having multiple Apps but having one
> Core App for common functions I wanted to use the bootstrap.php's
> $controllerPaths, $modelPaths and $viewPaths. I want to know if this
> will affect speed.
>
> In folder called 'core_app' I created a file called
> 'core_users_controller.php':
>
> class CoreUsersController extends AppController {}
>
> and 'users_controller.php':
>
> App::import('Controller', 'CoreUsers');
> class UsersController extends CoreUsersController {}
>
> In another folder 'app_a' I use the bootstrap to load the controllers
> in 'core_app.' This will allow me to use the Users controller but if
> need be allow me to override the Users controller by creating a new
> 'users_controller.php' file in 'app_a.' The same would apply for the
> Models and Views.
>
> I don't know if this is the best way but any other suggestions would
> be greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---