當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CTag類代碼示例

本文整理匯總了PHP中CTag的典型用法代碼示例。如果您正苦於以下問題:PHP CTag類的具體用法?PHP CTag怎麽用?PHP CTag使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CTag類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: italic

function italic($str)
{
    if (is_array($str)) {
        foreach ($str as $key => $val) {
            if (is_string($val)) {
                $em = new CTag('em', true);
                $em->addItem($val);
                $str[$key] = $em;
            }
        }
    } elseif (is_string($str)) {
        $em = new CTag('em', true, '');
        $em->addItem($str);
        $str = $em;
    }
    return $str;
}
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:17,代碼來源:html.inc.php

示例2: bold

function bold($str)
{
    if (is_array($str)) {
        foreach ($str as $key => $val) {
            if (is_string($val)) {
                $b = new CTag('strong', 'yes');
                $b->addItem($val);
                $str[$key] = $b;
            }
        }
    } else {
        $b = new CTag('strong', 'yes', '');
        $b->addItem($str);
        $str = $b;
    }
    return $str;
}
開發者ID:quanta-computing,項目名稱:debian-packages,代碼行數:17,代碼來源:html.inc.php

示例3: __construct

 public function __construct($label, $for = null)
 {
     parent::__construct('label', true, $label);
     if ($for !== null) {
         $this->setAttribute('for', zbx_formatDomId($for));
     }
 }
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:7,代碼來源:CLabel.php

示例4: setAction

 public function setAction($value = NULL)
 {
     if (is_null($value)) {
         return $this->attributes['action'] = $page['file'];
     }
     return parent::addAction('onclick', $value);
 }
開發者ID:phedders,項目名稱:zabbix,代碼行數:7,代碼來源:class.clink.php

示例5: __construct

 public function __construct($value, $class = null, $id = null)
 {
     parent::__construct('li', 'yes');
     $this->addItem($value);
     $this->addClass($class);
     $this->attr('id', $id);
 }
開發者ID:TonywalkerCN,項目名稱:Zabbix,代碼行數:7,代碼來源:CListItem.php

示例6: __construct

 /**
  * @param array $options['objectOptions'] 	an array of parameters to be added to the request URL
  *
  * @see jQuery.multiSelect()
  */
 public function __construct(array $options = [])
 {
     parent::__construct('div', true);
     $this->addClass('multiselect');
     $this->setId(zbx_formatDomId($options['name']));
     // url
     $url = new CUrl('jsrpc.php');
     $url->setArgument('type', PAGE_TYPE_TEXT_RETURN_JSON);
     $url->setArgument('method', 'multiselect.get');
     $url->setArgument('objectName', $options['objectName']);
     if (!empty($options['objectOptions'])) {
         foreach ($options['objectOptions'] as $optionName => $optionvalue) {
             $url->setArgument($optionName, $optionvalue);
         }
     }
     $params = ['url' => $url->getUrl(), 'name' => $options['name'], 'labels' => ['No matches found' => _('No matches found'), 'More matches found...' => _('More matches found...'), 'type here to search' => _('type here to search'), 'new' => _('new'), 'Select' => _('Select')]];
     if (array_key_exists('data', $options)) {
         $params['data'] = zbx_cleanHashes($options['data']);
     }
     foreach (['ignored', 'defaultValue', 'disabled', 'selectedLimit', 'addNew'] as $option) {
         if (array_key_exists($option, $options)) {
             $params[$option] = $options[$option];
         }
     }
     if (array_key_exists('popup', $options)) {
         foreach (['parameters', 'width', 'height'] as $option) {
             if (array_key_exists($option, $options['popup'])) {
                 $params['popup'][$option] = $options['popup'][$option];
             }
         }
     }
     zbx_add_post_js('jQuery("#' . $this->getAttribute('id') . '").multiSelect(' . CJs::encodeJson($params) . ');');
 }
開發者ID:jbfavre,項目名稱:debian-zabbix,代碼行數:38,代碼來源:CMultiSelect.php

示例7: addItem

 public function addItem($value)
 {
     if (strtolower(get_class($value)) != 'carea') {
         return $this->error('Incorrect value for addItem [' . $value . ']');
     }
     return parent::addItem($value);
 }
開發者ID:rennhak,項目名稱:zabbix,代碼行數:7,代碼來源:class.cmap.php

示例8: bodyToString

 public function bodyToString()
 {
     $ret = parent::bodyToString();
     $ret .= $this->srcParam->toString();
     $ret .= $this->embededFlash->toString();
     return $ret;
 }
開發者ID:omidmt,項目名稱:zabbix-greenplum,代碼行數:7,代碼來源:CFlash.php

示例9: addItem

 public function addItem($value)
 {
     if (is_object($value) && zbx_strtolower(get_class($value)) != 'carea') {
         return $this->error('Incorrect value for addItem "' . $value . '".');
     }
     return parent::addItem($value);
 }
開發者ID:SandipSingh14,項目名稱:Zabbix_,代碼行數:7,代碼來源:class.careamap.php

示例10: __construct

 public function __construct($name = 'file', $value = '')
 {
     parent::__construct('input', 'no');
     $this->setClass('biginput');
     $this->setAttribute('type', 'file');
     $this->setName($name);
     $this->setFile($value);
 }
開發者ID:songyuanjie,項目名稱:zabbix-stats,代碼行數:8,代碼來源:class.cfile.php

示例11: addItem

 public function addItem($value, $class = null, $id = null)
 {
     if (!is_null($value) && $this->emptyList) {
         $this->emptyList = false;
         $this->items = array();
     }
     parent::addItem($this->prepareItem($value, $class, $id));
 }
開發者ID:quanta-computing,項目名稱:debian-packages,代碼行數:8,代碼來源:class.clist.php

示例12: __construct

 public function __construct($coords, $href, $alt, $shape)
 {
     parent::__construct('area', 'no');
     $this->setCoords($coords);
     $this->setShape($shape);
     $this->setHref($href);
     $this->setAlt($alt);
 }
開發者ID:phedders,項目名稱:zabbix,代碼行數:8,代碼來源:class.carea.php

示例13: __construct

 public function __construct($name = '', $value = '0')
 {
     parent::__construct('input', 'no');
     $this->options['type'] = 'hidden';
     $this->options['name'] = $name;
     $this->options['id'] = $name;
     $this->setValue($value);
 }
開發者ID:rennhak,項目名稱:zabbix,代碼行數:8,代碼來源:class.cvartag.php

示例14: __construct

 public function __construct($value, $caption = NULL, $selected = NULL, $enabled = NULL)
 {
     parent::__construct('option', 'yes');
     $this->tag_body_start = '';
     $this->options['value'] = $value;
     $this->addItem($caption);
     $this->setSelected($selected);
     $this->setEnabled($enabled);
 }
開發者ID:rennhak,項目名稱:zabbix,代碼行數:9,代碼來源:class.ccomboitem.php

示例15: __construct

 public function __construct($value, $caption = null, $selected = null, $enabled = null)
 {
     parent::__construct('option', 'yes');
     $this->tag_body_start = '';
     $this->setAttribute('value', $value);
     $this->addItem($caption);
     $this->setSelected($selected);
     $this->setEnabled($enabled);
 }
開發者ID:quanta-computing,項目名稱:debian-packages,代碼行數:9,代碼來源:class.ccomboitem.php


注:本文中的CTag類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。