1 | Router::connect( "/css/*" , array ( "controller" => "css" , "action" => "index" )); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | App::uses( 'AppController' , 'Controller' ); class CssController extends AppController{ public function index(){ $this ->layout = false; $this ->response->type( "text/css" ); // ビューファイルから@charsetを省略する場合 // echo "@charset \"UTF-8\"; " . PHP_EOL; $path = func_get_args(); $fileName = implode( '/' , $path ); $this ->render( $fileName ); } } |
1 2 3 4 5 6 7 8 9 | @charset "UTF-8" ; /* ===================================== SVG背景画像 ===================================== */ /* ボタン ================================ */ .btn--search:before { background-image: url( "<?php echo $this->Html->url('/img/icn-search.svg'); ?>" ); } |
1 2 3 4 5 6 7 8 9 | @charset "UTF-8" ; /* ===================================== SVG背景画像 ===================================== */ /* ボタン ================================ */ .btn--search:before { background-image: url( "/cakephp/img/icn-search.svg" ); } |