本文整理汇总了PHP中Chamilo\CoreBundle\Framework\Container::getAsset方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::getAsset方法的具体用法?PHP Container::getAsset怎么用?PHP Container::getAsset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chamilo\CoreBundle\Framework\Container
的用法示例。
在下文中一共展示了Container::getAsset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: api_get_jquery_ui_css_web_path
/**
* @return string
*/
function api_get_jquery_ui_css_web_path()
{
return Container::getAsset()->getUrl("bundles/chamilocore/components/jquery-ui/themes/smoothness/jquery-ui.min.css");
}
示例2: return_icon
/**
* This public function returns the htmlcode for an icon
*
* @param string The filename of the file (in the main/img/ folder
* @param string The alt text (probably a language variable)
* @param array Additional attributes (for instance height, width, onclick, ...)
* @param integer The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
* @return string An HTML string of the right <img> tag
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University 2006
* @author Julio Montoya 2010 Function improved, adding image constants
* @author Yannick Warnier 2011 Added size handler
* @version Feb 2011
*/
public static function return_icon($image, $alt_text = '', $additional_attributes = array(), $size = ICON_SIZE_SMALL, $show_text = true, $return_only_path = false, $loadThemeIcon = true)
{
$image = trim($image);
$size_extra = '';
if (isset($size)) {
$size_extra = $size . '/';
}
$icon = 'bundles/chamilocore/img/icons/' . $size_extra . $image;
$icon = Container::getAsset()->getUrl($icon);
if ($return_only_path) {
return $icon;
}
$img = self::img($icon, $alt_text, $additional_attributes);
if (SHOW_TEXT_NEAR_ICONS == true && !empty($alt_text)) {
if ($show_text) {
$img = "{$img} {$alt_text}";
}
}
return $img;
}
示例3: return_icon
/**
* This public function returns the htmlcode for an icon
*
* @param string The filename of the file (in the main/img/ folder
* @param string The alt text (probably a language variable)
* @param array Additional attributes (for instance height, width, onclick, ...)
* @param integer The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
* @return string An HTML string of the right <img> tag
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University 2006
* @author Julio Montoya 2010 Function improved, adding image constants
* @author Yannick Warnier 2011 Added size handler
* @version Feb 2011
*/
public static function return_icon($image, $alt_text = '', $additional_attributes = array(), $size = ICON_SIZE_SMALL, $show_text = true, $return_only_path = false)
{
$code_path = api_get_path(SYS_IMG_PATH);
$w_code_path = api_get_path(WEB_CODE_PATH);
$alternateCssPath = api_get_path(SYS_CSS_PATH);
$alternateWebCssPath = api_get_path(WEB_CSS_PATH);
$image = trim($image);
$theme = 'themes/' . api_get_visual_theme() . '/icons/';
$size_extra = '';
if (isset($size)) {
$size = intval($size);
$size_extra = $size . '/';
} else {
$size = ICON_SIZE_SMALL;
}
//Checking the theme icons folder example: app/Resources/public/css/themes/chamilo/icons/XXX
if (is_file($alternateCssPath . $theme . $size_extra . $image)) {
$icon = $theme . $size_extra . $image;
} elseif (is_file($code_path . 'icons/' . $size_extra . $image)) {
//Checking the main/img/icons/XXX/ folder
$icon = 'icons/' . $size_extra . $image;
} else {
//Checking the img/ folder
$icon = $image;
}
// Special code to enable SVG - refs #7359 - Needs more work
// The code below does something else to "test out" SVG: for each icon,
// it checks if there is an SVG version. If so, it uses it.
// When moving this to production, the return_icon() calls should
// ask for the SVG version directly
$testServer = api_get_setting('server_type');
/*if ($testServer == 'test' && $return_only_path == false) {
$svgImage = substr($image, 0, -3) . 'svg';
if (is_file($code_path . $theme . 'svg/' . $svgImage)) {
$icon = $w_code_path . $theme . 'svg/' . $svgImage;
} elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) {
$icon = $w_code_path . 'img/icons/svg/' . $svgImage;
}
if (empty($additional_attributes['height'])) {
$additional_attributes['height'] = $size;
}
if (empty($additional_attributes['width'])) {
$additional_attributes['width'] = $size;
}
}*/
$icon = 'bundles/chamilocore/img/' . $icon;
$icon = Container::getAsset()->getUrl($icon);
//$icon = api_get_cdn_path($icon);
if ($return_only_path) {
return $icon;
}
$img = self::img($icon, $alt_text, $additional_attributes);
if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) {
if ($show_text) {
$img = "{$img} {$alt_text}";
}
}
return $img;
}
示例4: return_icon
/**
* This public function returns the htmlcode for an icon
*
* @param string The filename of the file (in the main/img/ folder
* @param string The alt text (probably a language variable)
* @param array Additional attributes (for instance height, width, onclick, ...)
* @param integer The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
* @return string An HTML string of the right <img> tag
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University 2006
* @author Julio Montoya 2010 Function improved, adding image constants
* @author Yannick Warnier 2011 Added size handler
* @version Feb 2011
*/
public static function return_icon($image, $alt_text = '', $additional_attributes = array(), $size = ICON_SIZE_SMALL, $show_text = true, $return_only_path = false)
{
$code_path = api_get_path(SYS_IMG_PATH);
$w_code_path = api_get_path(WEB_IMG_PATH);
$image = trim($image);
$theme = 'css/' . api_get_visual_theme() . '/icons/';
$size_extra = '';
if (isset($size)) {
$size = intval($size);
$size_extra = $size . '/';
} else {
$size = ICON_SIZE_SMALL;
}
// Checking the theme icons folder example: main/css/chamilo/icons/XXX
if (is_file($code_path . $theme . $size_extra . $image)) {
$icon = $theme . $size_extra . $image;
} elseif (is_file($code_path . 'icons/' . $size_extra . $image)) {
//Checking the main/img/icons/XXX/ folder
$icon = 'icons/' . $size_extra . $image;
} else {
//Checking the img/ folder
$icon = $image;
}
$icon = 'bundles/chamilocore/img/' . $icon;
$icon = Container::getAsset()->getUrl($icon);
//$icon = api_get_cdn_path($icon);
if ($return_only_path) {
return $icon;
}
$img = self::img($icon, $alt_text, $additional_attributes);
if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) {
if ($show_text) {
$img = "{$img} {$alt_text}";
}
}
return $img;
}