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


PHP Chtml::tag方法代码示例

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


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

示例1: transform

 public function transform($output)
 {
     // toc process
     $toc = '';
     $output = parent::transform($output);
     if (preg_match_all('/<h2(?: id=".+")?>(.+?)<\\/h2>/', $output, $match, PREG_PATTERN_ORDER) > 1) {
         $toc = CHtml::openTag('div', array('class' => 'toc')) . CHtml::openTag('ol');
         for ($i = 0; $i < count($match[0]); $i++) {
             $text = $i + 1 . '. ' . $match[1][$i] . CHtml::link('¶', null, array('name' => 'ch' . $i, 'class' => 'anchor'));
             $html = CHtml::tag('h2', array('id' => 'ch' . $i), $text);
             $toc .= Chtml::tag('li', array(), CHtml::link($match[1][$i], '#ch' . $i));
             $output = str_replace($match[0][$i], $html, $output);
         }
         $toc .= CHtml::closeTag('ol') . CHtml::closeTag('div');
     }
     // image process
     $output = preg_replace_callback('#<img\\s+src=".+?"\\s+alt="(.+?)"(?:\\s+title="(.+?)")?\\s+/>#s', array(&$this, '_doImages_callback_format'), $output);
     return $toc . $output;
 }
开发者ID:nash635,项目名称:xunsearch,代码行数:19,代码来源:Markdown.php

示例2: actionGetClasses

 public function actionGetClasses()
 {
     if (!isset($_POST['major_id'])) {
         return;
     }
     $major_id = $_POST['major_id'];
     $classes = Major::model()->findByPk($major_id)->classes;
     $classes = CHtml::listData($classes, 'class_id', 'class_name');
     $htmlData = CHtml::tag('option', array('selected' => 'selected', 'value' => ''), '请选择班级');
     foreach ($classes as $value => $key) {
         $htmlData .= Chtml::tag('option', array('value' => $value), Chtml::encode($key));
     }
     echo json_encode(array('htmlData' => $htmlData));
 }
开发者ID:houyf,项目名称:class_system,代码行数:14,代码来源:ClassroomController.php

示例3: renderInfo

 public function renderInfo($name, array $metaData, $form = null)
 {
     $value = isset($metaData['content']) ? $metaData['content'] : '';
     if (is_array($value)) {
         throw new CException('wrong type' . $name);
     }
     $htmlOptions = $this->htmlOptions($metaData);
     return Chtml::tag('div', $htmlOptions, $value);
 }
开发者ID:sickpig,项目名称:LimeSurvey,代码行数:9,代码来源:SettingsWidget.php

示例4: renderHtml

 public function renderHtml($name, array $metaData, $form = null)
 {
     $out = '';
     $id = $name;
     $value = isset($metaData['current']) ? $metaData['current'] : '';
     $metaData['class'][] = 'htmleditor';
     $readOnly = isset($metaData['readOnly']) ? $metaData['readOnly'] : false;
     if (isset($metaData['label'])) {
         $out .= CHtml::label($metaData['label'], $id, $metaData['labelOptions']);
     }
     $out .= Chtml::tag('div', array('class' => implode(' ', $metaData['class'])), CHtml::textArea($id, $value, array('id' => $id, 'form' => $form, 'readonly' => $readOnly)));
     return $out;
 }
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:13,代码来源:SettingsWidget.php

示例5: actionGetDorms

 public function actionGetDorms()
 {
     if (!isset($_POST['building_id'])) {
         return;
     }
     $building_id = $_POST['building_id'];
     $dorms = Building::model()->findByPk($building_id)->dorms;
     $dorms = CHtml::listData($dorms, 'dorm_id', 'dorm_name');
     $htmlData = CHtml::tag('option', array('selected' => 'selected', 'value' => ''), '请选择宿舍');
     foreach ($dorms as $value => $key) {
         $htmlData .= Chtml::tag('option', array('value' => $value), Chtml::encode($key));
     }
     echo json_encode(array('htmlData' => $htmlData));
 }
开发者ID:houyf,项目名称:class_system,代码行数:14,代码来源:DormController.php

示例6: renderItems

 /**
  * Renders widget items.
  */
 public function renderItems()
 {
     $items = array();
     foreach ($this->items as $item) {
         $items[] = $this->renderItem($item);
     }
     return \Chtml::tag('ul', $this->options, implode("\n", $items));
 }
开发者ID:abudayah,项目名称:yiiwheels-custom,代码行数:11,代码来源:Nav.php

示例7: actionGetBuildings

 public function actionGetBuildings()
 {
     if (!isset($_POST['area_id'])) {
         return;
     }
     $area_id = $_POST['area_id'];
     $buildings = CampusArea::model()->findByPk($area_id)->buildings;
     $buildings = CHtml::listData($buildings, 'building_id', 'building_id');
     $htmlData = CHtml::tag('option', array('selected' => 'selected', 'value' => ''), '请选择楼栋');
     foreach ($buildings as $value => $key) {
         $htmlData .= Chtml::tag('option', array('value' => $value), Chtml::encode($key . '号'));
     }
     echo json_encode(array('htmlData' => $htmlData));
 }
开发者ID:houyf,项目名称:class_system,代码行数:14,代码来源:BuildingController.php

示例8: actionMatkul

 public function actionMatkul()
 {
     $data = Kurikulum::model()->findAll('ID_KUR=:id', array(':id' => (int) $_POST['Jadwal']['ID_KUR']));
     $return = CHtml::listData($data, 'KODE_MK', 'KODE_MK');
     foreach ($return as $value => $KODE_MK) {
         echo Chtml::tag('option', array('value' => $value), CHtml::encode($KODE_MK), true);
     }
     echo Chtml::tag('option', array('value' => 'Kosong1'), CHtml::encode('Free'));
 }
开发者ID:jumper2012,项目名称:SmartCard,代码行数:9,代码来源:JadwalController.php

示例9: renderHtml

 public function renderHtml($name, array $metaData, $form = null)
 {
     $out = '';
     $id = $name;
     $value = isset($metaData['current']) ? $metaData['current'] : '';
     $metaData['class'][] = 'htmleditor';
     $readOnly = isset($metaData['readOnly']) ? $metaData['readOnly'] : false;
     if (isset($metaData['label'])) {
         $out .= CHtml::label($metaData['label'], $id, $metaData['labelOptions']);
     }
     $out .= Chtml::tag('div', array('class' => implode(' ', $metaData['class'])), $this->widget('bootstrap.widgets.TbHtml5Editor', array('name' => $id, 'value' => $value, 'width' => '100%', 'editorOptions' => array('html' => true)), true));
     return $out;
 }
开发者ID:josetorerobueno,项目名称:test_repo,代码行数:13,代码来源:SettingsWidget.php

示例10: actionMatkuljadwal

 public function actionMatkuljadwal($kbk)
 {
     $id_kur = (int) $_POST['MJadwal']['ID_KUR'];
     $kuliah = CHtml::listData(Kurikulum::model()->findAll(array('condition' => "ID_KUR = '{$id_kur}' AND (KBK_ID LIKE '{$kbk}' OR KBK_ID LIKE 'all')")), 'KODE_MK', 'KODE_MK');
     //        $kurikulum = Kurikulum::model()->findAllByAttributes(array('ID_KUR' => $id_kur));
     //        $data = Kurikulum::model()->findAll(
     //                "ID_KUR=:id ", array(':id' => (int) $_POST['MJadwal']['ID_KUR']));
     //        $return = CHtml::listData($kuliah, 'KODE_MK', 'KODE_MK');
     foreach ($kuliah as $value => $KODE_MK) {
         echo Chtml::tag('option', array('value' => $value), CHtml::encode($KODE_MK), true);
     }
     echo Chtml::tag('option', array('value' => 'Kosong'), CHtml::encode('Free'));
 }
开发者ID:jumper2012,项目名称:SmartCard,代码行数:13,代码来源:MJadwalController.php

示例11: htmlListFromQueryAll

 private function htmlListFromQueryAll($aStrings, $htmlOptions = array())
 {
     $sHtmlList = array();
     if (!empty($aStrings)) {
         foreach ($aStrings as $aString) {
             #                if(is_string($aString))
             #                    $sHtmlList[]=CHtml::tag("li",array(),$aString);
             #                else
             $sHtmlList[] = CHtml::tag("li", array(), current($aString));
         }
         return Chtml::tag("ul", array('class' => 'kce-answerstext'), implode($sHtmlList, "\n"));
     }
 }
开发者ID:SondagesPro,项目名称:LS-AutoComment_IterativeQuestionnaire,代码行数:13,代码来源:autoCommentIterativeQuestionnaire.php


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