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


PHP CHtml::renderAttributes方法代码示例

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


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

示例1: renderContainer

 /**
  * Renders container where to allocate the chart.
  */
 public function renderContainer()
 {
     // if no container is set, it will create one
     if ($this->containerId == null) {
         $this->containerId = 'div-chart' . $this->options['id'];
         echo '<div ' . \CHtml::renderAttributes($this->options) . '></div>';
     }
 }
开发者ID:abudayah,项目名称:yiiwheels-custom,代码行数:11,代码来源:Visualization.php

示例2: run

 /**
  * Widget's run method
  */
 public function run() {
     $id = $this->getId();
     // if no container is set, it will create one
     if ($this->containerId == null) {
         $this->htmlOptions['id'] = 'div-chart' . $id;
         $this->containerId = $this->htmlOptions['id'];
         echo '<div ' . CHtml::renderAttributes($this->htmlOptions) . '></div>';
     }
     $this->registerClientScript();
 }
开发者ID:Rajagunasekaran,项目名称:BACKUP,代码行数:13,代码来源:HzlVisualizationChart.php

示例3: alert

 /**
  * Returns an alert box
  *
  * @param string $content the text within the alert box
  * @param array $htmlOptions the HTML attributes of the alert box
  * @param string $close the label for the close button. Set to false if you don't wish to display it.
  * @return string the alert box
  * @see http://foundation.zurb.com/docs/components/alert-boxes.html
  */
 public static function alert($content, $htmlOptions = array(), $close = '&times')
 {
     ArrayHelper::addValue('class', 'alert-box', $htmlOptions);
     ob_start();
     echo '<div data-alert ' . \CHtml::renderAttributes($htmlOptions) . '>';
     echo $content;
     if ($close !== false) {
         echo static::closeLink($close);
     }
     echo '</div>';
     return ob_get_clean();
 }
开发者ID:2amigos,项目名称:yiifoundation,代码行数:21,代码来源:Alert.php

示例4: renderMenu

 /**
  * Renders the menu.
  * 
  * @param mixed $items normalized list of items
  */
 protected function renderMenu($items)
 {
     $htmlOptions = $this->htmlOptions;
     if (!isset($htmlOptions['id'])) {
         $htmlOptions['id'] = $this->getId();
     }
     if (!isset($htmlOptions['class'])) {
         $htmlOptions['class'] = 'yiiListMenu';
     }
     echo '<ul' . CHtml::renderAttributes($htmlOptions) . '>';
     $this->renderMenuRecurse($items);
     echo '</ul>';
 }
开发者ID:BGCX261,项目名称:zii-svn-to-git,代码行数:18,代码来源:CListMenu.php

示例5: run

 /**
  * Renders the widget.
  */
 public function run()
 {
     $id = $this->getId();
     // if there is no renderTo id, build the layer with current id and initialize renderTo option
     if (!isset($this->options['chart']) || !isset($this->options['chart']['renderTo'])) {
         $this->htmlOptions['id'] = $id;
         echo '<div ' . CHtml::renderAttributes($this->htmlOptions) . ' ></div>';
         if (isset($this->options['chart']) && is_array($this->options['chart'])) {
             $this->options['chart']['renderTo'] = $id;
         } else {
             $this->options['chart'] = array('renderTo' => $id);
         }
     }
     $this->registerClientScript();
 }
开发者ID:azizbekvahidov,项目名称:foods,代码行数:18,代码来源:TbHighCharts.php

示例6: renderDataCell

 /**
  * Renders|returns the data cell.
  *
  * @param int $row
  *
  * @return array|void
  */
 public function renderDataCell($row)
 {
     if ($this->grid->json) {
         $data = $this->grid->dataProvider->data[$row];
         $options = $this->htmlOptions;
         if ($this->cssClassExpression !== null) {
             $class = $this->evaluateExpression($this->cssClassExpression, array('row' => $row, 'data' => $data));
             if (!empty($class)) {
                 if (isset($options['class'])) {
                     $options['class'] .= ' ' . $class;
                 } else {
                     $options['class'] = $class;
                 }
             }
         }
         return array('attrs' => CHtml::renderAttributes($options), 'content' => $this->renderDataCellContent($row, $data));
     }
     parent::renderDataCell($row);
 }
开发者ID:zhaoyan158567,项目名称:YiiBooster,代码行数:26,代码来源:TbJsonCheckBoxColumn.php

示例7: tableHead

 public static function tableHead($link, $header, $options = array())
 {
     $out = '';
     $page = (int) Yii::app()->request->getQuery('page');
     $page = $page > 0 ? $page : 1;
     $sort = Yii::app()->request->getQuery('sort');
     $sort = empty($sort) ? 'asc' : $sort;
     $order = Yii::app()->request->getQuery('order');
     foreach ($header as $field => $title) {
         $th_attrs = array();
         if (is_array($title)) {
             $th_attrs = isset($title[1]) ? $title[1] : array();
             $title = $title[0];
         }
         $params = array('order' => $field, 'sort' => $sort == 'asc' ? 'desc' : 'asc');
         if (isset($options['page']) && $options['page']) {
             $params['page'] = $page;
         }
         if (isset($options['query']) && is_array($options['query'])) {
             $params = array_merge($params, $options['query']);
         }
         $out .= '<th' . CHtml::renderAttributes($th_attrs) . '>';
         if (is_string($field)) {
             $out .= '<a href="' . Yii::app()->createUrl($link, $params) . '">';
         }
         $out .= $title;
         if (is_string($field)) {
             if ($order == $field) {
                 $out .= $sort == 'asc' ? ' <i class="icon-chevron-up"></i>' : ' <i class="icon-chevron-down"></i>';
             }
             $out .= '</a>';
         }
         $out .= '</th>';
     }
     return $out;
 }
开发者ID:priyranjansingh,项目名称:getleads,代码行数:36,代码来源:Utility.php

示例8: run

 /**
  *### .run()
  *
  * Runs the widget.
  * @since  9/21/12 8:13 PM  antonio ramirez <antonio@clevertech.biz>
  * Updated to use stacked progress bars
  */
 public function run()
 {
     echo CHtml::openTag('div', $this->htmlOptions);
     if (empty($this->stacked)) {
         echo '<div class="bar" style="width: ' . $this->percent . '%;">' . $this->content . '</div>';
     } elseif (is_array($this->stacked)) {
         foreach ($this->stacked as $bar) {
             $options = isset($bar['htmlOptions']) ? $bar['htmlOptions'] : array();
             if (empty($options['style'])) {
                 $options['style'] = '';
             } else {
                 $options['style'] .= ' ';
             }
             $options['style'] .= 'width: ' . $bar['percent'] . '%';
             if (empty($options['class'])) {
                 $options['class'] = '';
             } else {
                 $options['style'] .= ' ';
             }
             $options['class'] .= 'bar bar-' . $bar['type'];
             echo '<div ' . CHtml::renderAttributes($options) . '>' . @$bar['content'] . '</div>';
         }
     }
     echo '</div>';
 }
开发者ID:phiphi1992,项目名称:alongaydep,代码行数:32,代码来源:TbProgress.php

示例9: array

 column end">
	<?php 
}
?>
	<?php 
$attr = array('id' => CHtml::modelName($element) . '_' . $field, 'name' => CHtml::modelName($element) . '[' . $field . ']', 'placeholder' => @$htmlOptions['placeholder']);
if ($rows) {
    $attr['rows'] = $rows;
}
if ($cols) {
    $attr['cols'] = $cols;
}
?>
 	<textarea
			<?php 
echo CHtml::renderAttributes(array_merge($htmlOptions, $attr));
?>
><?php 
echo CHtml::encode($value);
?>
</textarea>
		<?php 
if (!$nowrapper) {
    ?>
			<?php 
    if ($button) {
        ?>
				<button type="submit" class="<?php 
        echo $button['colour'];
        ?>
 <?php 
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:31,代码来源:TextArea.php

示例10: renderExtendedSummary

 /**
  *### .renderExtendedSummary()
  *
  * Renders summary
  */
 public function renderExtendedSummary()
 {
     if (!isset($this->extendedSummaryOptions['class'])) {
         $this->extendedSummaryOptions['class'] = $this->extendedSummaryCssClass;
     } else {
         $this->extendedSummaryOptions['class'] .= ' ' . $this->extendedSummaryCssClass;
     }
     echo '<div ' . CHtml::renderAttributes($this->extendedSummaryOptions) . '></div>';
 }
开发者ID:yinhe,项目名称:yincart,代码行数:14,代码来源:TbExtendedGridView.php

示例11: addStylesheetTag

 /**
  *
  * Adds stylesheet support
  * @param array $htmlOptions 
  */
 public function addStylesheetTag($htmlOptions)
 {
     if (!is_array($htmlOptions)) {
         throw new CException(Yii::t('EFeed', __FUNCTION__ . ' parameter must be an array.'));
     }
     $this->stylesheets[] = '<?xml-stylesheet ' . CHtml::renderAttributes($htmlOptions) . ' ?>';
 }
开发者ID:2amigos,项目名称:efeed,代码行数:12,代码来源:EFeed.php

示例12:

<?php

/**
 * @var Notify $notify
 */
$blockParams = ['class' => 'clearfix notify' . ($notify->isRead ? ' read' : ''), 'data-id' => $notify->id];
if ($notify->url) {
    $blockParams['onClick'] = "document.location.href = '" . $notify->url . "'";
}
?>

<div <?php 
echo CHtml::renderAttributes($blockParams);
?>
>
    <div class="left-block">
        <?php 
if ($notify->img) {
    ?>
            <div class="image">
                <?php 
    echo CHtml::image($notify->getImage());
    ?>
                <img src="<?php 
    echo $link;
    ?>
">
            </div>
        <?php 
}
?>
开发者ID:bookin,项目名称:yii-notification-center,代码行数:31,代码来源:_notify.php

示例13: renderChart

 /**
  * Renders a chart based on the data series specified
  * @throws CException
  */
 public function renderChart()
 {
     $displayChart = !empty($this->grid->chartOptions) && @$this->grid->chartOptions['data'] && $this->grid->dataProvider->getItemCount();
     if (!$displayChart || $this->grid->dataProvider->getItemCount() <= 0) {
         return null;
     }
     if (!isset($this->grid->chartOptions['data']['series'])) {
         throw new CException(Yii::t('zii', 'You need to set the "series" attribute in order to render a chart'));
     }
     $configSeries = $this->grid->chartOptions['data']['series'];
     if (!is_array($configSeries)) {
         throw new CException(Yii::t('zii', '"chartOptions.series" is expected to be an array.'));
     }
     if (!isset($this->grid->chartOptions['config'])) {
         $this->grid->chartOptions['config'] = array();
     }
     $this->renderChartControlButtons();
     $chartId = $this->grid->registerChartControlButtonsScript();
     // render Chart
     // chart options
     $data = $this->grid->dataProvider->getData();
     $count = count($data);
     $seriesData = array();
     $cnt = 0;
     foreach ($configSeries as $set) {
         $seriesData[$cnt] = array('name' => isset($set['name']) ? $set['name'] : null, 'data' => array());
         for ($row = 0; $row < $count; ++$row) {
             $column = $this->grid->getColumnByName($set['attribute']);
             if (!is_null($column) && $column->value !== null) {
                 $seriesData[$cnt]['data'][] = $this->evaluateExpression($column->value, array('data' => $data[$row], 'row' => $row));
             } else {
                 $value = CHtml::value($data[$row], $set['attribute']);
                 $seriesData[$cnt]['data'][] = is_numeric($value) ? (double) $value : $value;
             }
         }
         ++$cnt;
     }
     $options = CMap::mergeArray($this->grid->chartOptions['config'], array('series' => $seriesData));
     $this->grid->chartOptions['htmlOptions'] = isset($this->grid->chartOptions['htmlOptions']) ? $this->chartOptions['htmlOptions'] : array();
     // sorry but use a class to provide styles, we need this
     $this->grid->chartOptions['htmlOptions']['style'] = 'display:none';
     // build unique ID
     // important!
     echo '<div class="row-fluid">';
     if ($this->grid->ajaxUpdate !== false) {
         if (isset($options['chart']) && is_array($options['chart'])) {
             $options['chart']['renderTo'] = $chartId;
         } else {
             $options['chart'] = array('renderTo' => $chartId);
         }
         $jsOptions = CJSON::encode($options);
         if (isset($this->grid->chartOptions['htmlOptions']['data-config'])) {
             unset($this->grid->chartOptions['htmlOptions']['data-config']);
         }
         echo "<div id='{$chartId}' " . CHtml::renderAttributes($this->grid->chartOptions['htmlOptions']) . " data-config='{$jsOptions}'></div>";
         $this->grid->componentsAfterAjaxUpdate[] = "highchart{$chartId} = new Highcharts.Chart(\$('#{$chartId}').data('config'));";
     }
     $configChart = array('class' => 'yiiwheels.widgets.highcharts.WhHighCharts', 'id' => $chartId, 'pluginOptions' => $options, 'htmlOptions' => $this->grid->chartOptions['htmlOptions']);
     $chart = Yii::createComponent($configChart);
     $chart->init();
     $chart->run();
     echo '</div>';
 }
开发者ID:nicovicz,项目名称:reward-point,代码行数:67,代码来源:WhChart.php

示例14: checkBox

 /**
  * Generates a check box.
  * @param string $name the input name
  * @param boolean $checked whether the check box is checked
  * @param array $htmlOptions additional HTML attributes. Besides normal HTML attributes, a few special
  * attributes are also recognized (see {@link clientChange} and {@link tag} for more details.)
  * Since version 1.1.2, a special option named 'uncheckValue' is available that can be used to specify
  * the value returned when the checkbox is not checked. When set, a hidden field is rendered so that
  * when the checkbox is not checked, we can still obtain the posted uncheck value.
  * If 'uncheckValue' is not set or set to NULL, the hidden field will not be rendered.
  * @return string the generated check box
  * @see clientChange
  * @see inputField
  */
 public static function checkBox($name, $checked = false, $htmlOptions = array())
 {
     $label = self::popOption('label', $htmlOptions, '');
     $labelOptions = self::popOption('labelOptions', $htmlOptions, array());
     $checkBox = CHtml::checkBox($name, $checked, $htmlOptions);
     if ($label) {
         $labelOptions = self::addClassName('checkbox', $labelOptions);
         ob_start();
         echo '<label ' . CHtml::renderAttributes($labelOptions) . '>';
         echo $checkBox;
         echo $label;
         echo '</label>';
         return ob_get_clean();
     }
     return $checkBox;
 }
开发者ID:yii-twbs,项目名称:yiistrap,代码行数:30,代码来源:TbHtml.php

示例15: array

/** @var TbActiveForm $form */
?>
<fieldset>

    <legend>
        <?php 
if ($this->backUrl) {
    echo CHtml::link('', $this->backUrl, array('class' => 'icon-back'));
}
?>
        <?php 
echo $this->title;
?>
    </legend>
        <?php 
echo '<', $this->listTag, CHtml::renderAttributes($this->listOptions), '>';
foreach ($this->listItemData as $item) {
    $this->controller->renderPartial($this->listItemView, array('item' => $item));
}
echo '</', $this->listTag, '>';
?>
</fieldset>
<div class="form-actions">
    <a href="<?php 
echo $this->addButtonLink;
?>
" class="btn-item-add"><i class="icon-plus"></i> <?php 
echo $this->addButtonText;
?>
</a>
    <?php 
开发者ID:eneelkant,项目名称:oprecx-project,代码行数:31,代码来源:sort_form.php


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