dinsdag 9 juni 2009

CakePHP themes 1 minute HOWTO

Did you that it only takes a minute to start using themes for your CakePHP application? No? It's just these steps you need to start using themes:

1. In your (app)controller: var $view = 'Theme';
2. In your (app)controller: var $theme = 'orange';
3. Or from a function: $this->theme = 'orange';

That's it! You can now create custom views and layouts for this theme under /app/views/themed/orange. Below that folder you should use the same structure as under /app/views. For example, create a file /app/views/themed/orange/layouts/default.ctp.

So, if theme-specific files exist in themed folders, these will be used, else, CakePHP switched back to the default layouts and views.

You can also create custom CSS and JS files under /app/webroot/themed/orange/css and /app/webroot/themed/orange/js.

Pretty easy huh...

Did you already use themes?

3 opmerkingen:

  1. If some one needs expert view about blogging and site-building afterward i recommend him/her to visit this
    web site, Keep up the nice work.

    My web-site - compositor

    BeantwoordenVerwijderen
  2. I was suggested this web site by my cousin.
    I'm not sure whether this post is written by him as nobody else know such detailed about my difficulty. You are amazing! Thanks!

    Also visit my webpage :: Creating A Website From Scratch

    BeantwoordenVerwijderen