Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Prefixルーティングとthemeのススメ

1,170 views

Published on

Published in: Technology, Spiritual
  • Be the first to comment

  • Be the first to like this

Prefixルーティングとthemeのススメ

  1. 1. prefixTheme 312 12CakePHP2.0CakePHP Advent Calendar 2011 #12
  2. 2. @slumbers99http://slumbers99.blogspot.com/ MBA Mac 10
  3. 3. 3docomo au softbank
  4. 4. prefixTheme
  5. 5. prefixprefix admin
  6. 6. prefix file : /app/configs/core.phpConfigure::write(‘Routing.prefixes’, array(‘do’, ‘au’,‘sb’));$this->Html->url(array(‘au’ => true));url : /au/posts/index
  7. 7. prefixClass PostsController extends AppController{ public function au_index() { // /au/posts/index // /app/views/posts/au_index.ctp } public function do_index() { // /do/posts/index // /app/views/posts/do_index.ctp }}
  8. 8. Themeθíːm ≠core.php
  9. 9. ThemeTheme $theme
  10. 10. ThemeClass PostsController extends AppController{ public $view = ‘Theme’; public $theme = ‘au’; public function beforeFilter() { // if ($result) { $this->theme = ‘au’; } }}
  11. 11. Theme/app/views/themed/au/viewsthemed
  12. 12. prefixTheme

×