Assets を使用して、サブフォルダーにあるファイルを含めることはできますか?
例: [base_url] /assets/css/pepper-grinder/jquery-ui-1.8.11.custom.min.css
Assets を使用して、サブフォルダーにあるファイルを含めることはできますか?
例: [base_url] /assets/css/pepper-grinder/jquery-ui-1.8.11.custom.min.css
これを使用して、asset/フォルダーのサブフォルダーにアクセスできます。
// Image in /assets/img1.jpg
print Asset::img("img1.png");
// Image in /assets/subfolder/img2.jpg
print Asset::img("subfolder/img2.jpg");
では./fuel/core/config/asset.php
、次のコードを変更できます。
/**
* An array of paths that will be searched for assets. Each asset is a
* RELATIVE path from the base_url WITH a trailing slash:
*
* array('assets/')
*/
'paths' => array(''),
と
/**
* Asset Sub-folders
*
* Names for the img, js and css folders (inside the asset path).
*
* Examples:
*
* img/
* js/
* css/
*
* This MUST include the trailing slash ('/')
*/
'img_dir' => 'img/',
'js_dir' => 'js/',
'css_dir' => 'css/'
paths
beassets
およびcss_dir
to beに構成する場合は、次を使用してcss/
含めることができます[base_url] /assets/css/pepper-grinder/jquery-ui-1.8.11.custom.min.css
echo Asset::css('pepper-grinder/jquery-ui-1.8.11.custom.min.css');
そうです、asset.php のパスを好きなように設定するだけです。
$config['asset_paths'] = array('assets/');
それは、アセット ライブラリを使用する場合です。それ以外の場合は、webroot からの絶対パスにします。