Theming you app is a piece of cake ;). All you have to do is set a
couple of controller fields:
class MyController extends AppController {
var $view = 'Theme';
var $theme = 'mytheme';
}
then in your views and webroot directories you´d create:
views\
themed\
mytheme\
layouts\
elements\
any_other_views_you_want_to_override\
(...)\
webroot\
themed\
mytheme\
css\
js\
img\
(...)\
Then as long as you stick to using cake helpers for css, images,
javascript and so on the framework is smart enough to look for whatever
asset you require in the correponding theme directory and move up the
tree into the base directory if it's not found. This is quite handy as
it allows you to customize only the necessary bits for your new themes.
You can also employ some theme switching code in one of AppControllers
callbacks to allow for user selectable themes or configuration based themes.
As for maintining admin views in separete folders, I can't recall any
way of doing it, but then again I've never needed this type of
functionality. You could probably manage to do it setting the $viewPath
field in the controller but I haven't tried it. Another thing you could
do is create an admin theme and have something like this in your
AppController:
beforeFilter(0 {
parent::beforeFilter();
if (isset($this->params[Configure::read('Routing.admin')]) &&
$this->params[Configure::read('Routing.admin')]) {
$this->view = 'Theme';
$this->theme = 'admin';
}
}
shahgeb wrote:
> Hy i am new to cakephp. I want to maintain different directories for
> admin view and client view, meanwhile i want to make themeable as
> well.
>
> any idea from seniors ???????????????????????????????????
> thanks
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---