当前位置: 首页>>代码示例>>PHP>>正文


PHP Icon::create2方法代码示例

本文整理汇总了PHP中Icon::create2方法的典型用法代码示例。如果您正苦于以下问题:PHP Icon::create2方法的具体用法?PHP Icon::create2怎么用?PHP Icon::create2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Icon的用法示例。


在下文中一共展示了Icon::create2方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($content = '', $icon = false)
 {
     parent::__construct($content);
     if ($icon) {
         $this->setIcon(is_string($icon) ? Icon::create2($icon) : $icon);
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:InfoboxElement.php

示例2: __construct

 /**
  * create a link for a widget
  *
  * @param String $label      Label/content of the link
  * @param String $url        URL/Location of the link
  * @param Mixed  $icon       Icon for the link, should be an Icon
  *                           object; until v3.6 this may be a string
  * @param array  $attributes HTML-attributes for the a-tag in an associative array.
  */
 public function __construct($label, $url, $icon = null, $attributes = array())
 {
     parent::__construct();
     $this->label = $label;
     $this->url = $url;
     $this->attributes = $attributes;
     // DEPRECATED
     // TODO icon may be a string until v3.6
     $this->icon = is_string($icon) ? Icon::create2($icon) : $icon;
 }
开发者ID:ratbird,项目名称:hope,代码行数:19,代码来源:LinkElement.php

示例3: setActiveImage

 /**
  * Set the image for the active state of this navigation item.
  * If no active image is set, the normal image is used for the
  * active state. Additional HTML attributes can be passed using
  * the $options parameter (like 'style' or 'onclick').
  *
  * @param Icon   $image            an instance of class Icon depicting this item
  * @param array  $link_attributes  additional link attributes
  */
 public function setActiveImage($image, $link_attributes = [])
 {
     $this->active_image = $image;
     $this->setLinkAttributes($link_attributes);
     // DEPRECATED
     // TODO remove this case in v3.6
     if (is_string($image)) {
         $this->active_image = Icon::create2(Assets::image_path($image));
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:19,代码来源:Navigation.php

示例4: input

 /**
  * Returns an input tag using options as html attributes on the
  * tag, but with these special cases:
  *
  * * 'size' - Supplied as "X@Y", so "30@45" becomes width="30" and height="45"
  *
  * The source can be supplied as a...
  * * full path, like "/my_images/image.gif"
  * * file name, like "rss.png", that gets expanded to "/images/rss.png"
  * * file name without extension, like "logo", that gets expanded to "/images/logo.png"
  *
  * Do not use this to render icons. Use the more appropiate class
  * Icon for this.
  */
 static function input($source, $opt = array())
 {
     if (!$source) {
         return '';
     }
     $parts = explode('/', $source);
     if (($pos = array_search('icons', $parts)) !== false) {
         $source = substr($source, 6);
         $source = preg_replace('/\\.png$/', '', $source);
         return Icon::create2($source, $opt)->render(Icon::SVG | Icon::INPUT);
     }
     $size = $opt['size'];
     $opt = Assets::parse_attributes($opt);
     $opt['src'] = Assets::image_path($source);
     $opt['type'] = 'image';
     if (isset($size) && !isset($opt['width'])) {
         list($opt['width'], $opt['height']) = explode('@', $size, 2);
         unset($opt['size']);
     }
     return Assets::tag('input', $opt);
 }
开发者ID:ratbird,项目名称:hope,代码行数:35,代码来源:Assets.class.php

示例5: foreach

            Sidebar::get()->insertWidget($nav_links, ':first');
        }
    }
}
// TODO: Remove this after sidebar migration has been completed
if ($infobox && is_array($infobox)) {
    $sidebar = Sidebar::get();
    if (!$sidebar->getImage()) {
        $sidebar->setImage(is_object($infobox['picture']) ? $infobox['picture']->getURL(Avatar::NORMAL) : $infobox['picture']);
    }
    foreach ($infobox['content'] as $entry) {
        $widget = new InfoboxWidget();
        $widget->setTitle($entry['kategorie']);
        if (isset($entry['eintrag']) && is_array($entry['eintrag'])) {
            foreach (@$entry['eintrag'] as $row) {
                $icon = is_string($row['icon']) ? Icon::create2(str_replace('/black/', '/blue/', $row['icon'])) : $row['icon'];
                $widget->addElement(new InfoboxElement($row['text'], $icon));
            }
        }
        $sidebar->addWidget($widget);
    }
    unset($infobox);
}
?>
<!DOCTYPE html>
<html class="no-js">
<head>
    <meta charset="WINDOWS-1252">
    <title>
      <?php 
echo htmlReady(PageLayout::getTitle() . ' - ' . $GLOBALS['UNI_NAME_CLEAN']);
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:base.php

示例6: if

            <tr>
              <td colspan="2">
                <b><?php 
echo $category["kategorie"];
?>
</b>
              </td>
            </tr>

            <? if (isset($category['eintrag'])) : ?>
              <? foreach ($category['eintrag'] as $item) : ?>

                <tr>
                  <td width="1%" align="center" valign="top">
                    <?php 
echo is_string($item['icon']) ? Icon::create2($item['icon'])->asImg() : $item['icon']->asImg();
?>
                  </td>
                  <td width="99%">
                    <?php 
echo $item["text"];
?>
                  </td>
                </tr>

              <? endforeach ?>

            <? endif ?>
          <? endforeach ?>

        </table>
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:infobox_generic_content.php


注:本文中的Icon::create2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。