3

Assets を使用して、サブフォルダーにあるファイルを含めることはできますか?

例: [base_url] /assets/css/pepper-grinder/jquery-ui-1.8.11.custom.min.css

4

3 に答える 3

3

これを使用して、asset/フォルダーのサブフォルダーにアクセスできます。

// Image in /assets/img1.jpg
print Asset::img("img1.png"); 

// Image in /assets/subfolder/img2.jpg
print Asset::img("subfolder/img2.jpg");
于 2011-09-09T07:27:14.093 に答える
2

では./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/'

pathsbeassetsおよびcss_dirto beに構成する場合は、次を使用してcss/含めることができます[base_url] /assets/css/pepper-grinder/jquery-ui-1.8.11.custom.min.cssecho Asset::css('pepper-grinder/jquery-ui-1.8.11.custom.min.css');

于 2011-09-10T22:01:04.817 に答える
0

そうです、asset.php のパスを好きなように設定するだけです。

$config['asset_paths'] = array('assets/');

それは、アセット ライブラリを使用する場合です。それ以外の場合は、webroot からの絶対パスにします。

于 2011-06-13T18:41:25.750 に答える