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


PHP CInputWidget類代碼示例

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


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

示例1: run

 public function run()
 {
     parent::run();
     // Saves $id will be the id of the element that ckeditor will target
     list($name, $id) = $this->resolveNameID();
     // Publish assets to public directory
     $baseDir = dirname(__FILE__);
     $assets = Yii::app()->getAssetManager()->publish($baseDir . DIRECTORY_SEPARATOR . 'assets');
     $cs = Yii::app()->getClientScript();
     $cs->registerScriptFile($assets . '/ckeditor.js');
     echo CHtml::activeTextArea($this->model, $this->attribute, array('rows' => 10, 'cols' => 70));
     $this->options = array_merge(array('filebrowserBrowseUrl' => array('/backend/elfinderBrowse'), 'height' => '250px', 'allowedContent' => true), $this->options);
     $this->setConfig($this->options);
     $this->ECKE->replace($id, $this->_config);
 }
開發者ID:kuzmina-mariya,項目名稱:gallery,代碼行數:15,代碼來源:ECKEditorWidget.php

示例2: init

 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     Yii::import('bootstrap.behaviors.TbWidget');
     $this->attachBehavior('tbWidget', new TbWidget());
     if (!isset($this->assetPath)) {
         $this->assetPath = realpath(dirname(__FILE__) . '/../assets');
     }
     if (!$this->asDropDownList && !isset($this->pluginOptions['data'])) {
         $this->pluginOptions['data'] = $this->normalizeData($this->data);
     }
     if (isset($this->htmlOptions['placeholder'])) {
         if ($this->asDropDownList) {
             $this->htmlOptions['prompt'] = $this->htmlOptions['placeholder'];
         } else {
             $this->pluginOptions['placeholder'] = $this->htmlOptions['placeholder'];
         }
         unset($this->htmlOptions['placeholder']);
     }
     if (!$this->bindPlugin) {
         $this->htmlOptions['data-plugin'] = 'select2';
         $this->htmlOptions['data-plugin-options'] = CJSON::encode($this->pluginOptions);
     }
     if (TbArray::popValue('block', $this->htmlOptions, false)) {
         TbHtml::addCssClass('input-block-level', $this->htmlOptions);
     }
 }
開發者ID:nkovacs,項目名稱:yiistrap-select2,代碼行數:30,代碼來源:TbSelect2.php

示例3: init

 public function init()
 {
     $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'source';
     $this->baseurl = Yii::app()->getAssetManager()->publish($dir);
     $this->kcFinderPath = $this->baseurl . "/kcfinder/";
     parent::init();
 }
開發者ID:SallyU,項目名稱:footprints,代碼行數:7,代碼來源:CKkceditor.php

示例4: run

    public function run()
    {
        parent::run();
        list($name, $id) = $this->resolveNameID();
        $baseDir = dirname(__FILE__);
        $assets = Yii::app()->getAssetManager()->publish($baseDir . DIRECTORY_SEPARATOR . 'assets');
        $cs = Yii::app()->getClientScript();
        $cs->registerScriptFile($assets . '/ckeditor.js');
        $this->htmlOptions['id'] = $id;
        //        $this->htmlOptions['class'] = 'ckeditor';
        if (!array_key_exists('style', $this->htmlOptions)) {
            $this->htmlOptions['style'] = "width:{$this->width};height:{$this->height};";
        }
        if (!array_key_exists('cols', $this->htmlOptions)) {
            $this->htmlOptions['cols'] = self::COLS;
        }
        if (!array_key_exists('rows', $this->htmlOptions)) {
            $this->htmlOptions['rows'] = self::ROWS;
        }
        $options = $this->makeOptions();
        $js = <<<EOP
CKEDITOR.replace('{$name}',{$options});
EOP;
        $cs->registerScript('Yii.' . get_class($this) . '#' . $id, $js, CClientScript::POS_LOAD);
        if ($this->hasModel()) {
            $html = CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
        } else {
            $html = CHtml::textArea($name, $this->value, $this->htmlOptions);
        }
        echo $html;
    }
開發者ID:lhfcainiao,項目名稱:basic,代碼行數:31,代碼來源:CKEditor.php

示例5: init

 public function init()
 {
     parent::init();
     if (empty($this->model) || empty($this->attribute)) {
         throw new Exception("Model and Attribute must be declared");
     }
 }
開發者ID:uiDeveloper116,項目名稱:webstore,代碼行數:7,代碼來源:Codemirror.php

示例6: init

 public function init()
 {
     list($this->name, $this->id) = $this->resolveNameID();
     //не стал делать сеттер, если хочешь допиши
     $this->attachBehaviors($this->behaviors());
     parent::init();
 }
開發者ID:blindest,項目名稱:Yii-CMS-2.0,代碼行數:7,代碼來源:InputWidget.php

示例7: init

 public function init()
 {
     parent::init();
     list($name, $id) = $this->resolveNameID();
     $config = array("id" => $id, "height" => $this->height, "autogrow" => $this->autogrow);
     $js = 'window.setTimeout(function() { chive.initAce(' . json_encode($config) . '); }, 1000);';
     Yii::app()->clientScript->registerScript('Yii.AceEditor.' . $this->id, $js, CClientScript::POS_END);
 }
開發者ID:cebe,項目名稱:chive,代碼行數:8,代碼來源:AceEditor.php

示例8: init

 /**
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     parent::init();
     $this->options['class'] = $this->el;
     Yii::setAlias('@sirtrevorjs', dirname(__FILE__) . DIRECTORY_SEPARATOR . '..');
     $this->registerAsset();
     echo $this->renderInput();
 }
開發者ID:perminder-klair,項目名稱:yii2-sir-trevor-js,代碼行數:11,代碼來源:ESirTrevor.php

示例9: init

 public function init()
 {
     parent::init();
     Yii::import('bootstrap.behaviors.TbWidget');
     $this->attachBehavior('tbWidget', new TbWidget());
     if (!isset($this->assetPath)) {
         $this->assetPath = realpath(dirname(__FILE__) . '/../assets');
     }
 }
開發者ID:nkovacs,項目名稱:yiistrap-datetimepicker,代碼行數:9,代碼來源:TbDateTimePickerAssets.php

示例10: run

 /**
  * 運行
  */
 public function run()
 {
     parent::run();
     $assets = $this->getAssetsPath();
     $clientScript = Yii::app()->getClientScript();
     $clientScript->registerScriptFile($assets . '/ueditor.config.js', CClientScript::POS_END);
     $clientScript->registerScriptFile($assets . '/ueditor.all.min.js', CClientScript::POS_END);
     $clientScript->registerScriptFile($assets . '/lang/' . $this->language . '.js', CClientScript::POS_END);
     $clientScript->registerScript('content', $this->makeOptions(), CClientScript::POS_END);
 }
開發者ID:njz817,項目名稱:ycms,代碼行數:13,代碼來源:Ueditor.php

示例11: init

 public function init()
 {
     $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'source';
     $this->baseurl = Yii::app()->getAssetManager()->publish($dir);
     $this->kcFinderPath = $this->baseurl;
     $cs = Yii::app()->clientScript;
     $cs->registerCssFile($this->baseurl . "/run/kcfinder.css", "screen");
     $cs->registerScriptFile($this->baseurl . "/run/kcfinder.js");
     parent::init();
 }
開發者ID:fobihz,項目名稱:cndiesel,代碼行數:10,代碼來源:Ckcfinder.php

示例12: run

 /**
  * 運行
  */
 public function run()
 {
     parent::run();
     $this->assets = $assets = $this->getAssetsPath();
     $this->displayHtml();
     $clientScript = Yii::app()->getClientScript();
     $clientScript->registerCssFile($assets . '/default.css');
     $clientScript->registerScriptFile($assets . '/resumable.js', CClientScript::POS_END);
     $clientScript->registerScriptFile($assets . '/upload.js', CClientScript::POS_END);
 }
開發者ID:jerrylsxu,項目名稱:yiifcms,代碼行數:13,代碼來源:Resumable.php

示例13: run

 public function run()
 {
     parent::run();
     $assets = $this->getAssetsPath();
     $cs = Yii::app()->getClientScript();
     $cs->registerCssFile($assets . '/themes/default/default.css');
     $cs->registerCssFile($assets . '/plugins/code/prettify.css');
     $cs->registerScriptFile($assets . '/kindeditor.js', CClientScript::POS_HEAD);
     $cs->registerScriptFile($assets . '/lang/zh_CN.js', CClientScript::POS_HEAD);
     $cs->registerScriptFile($assets . '/plugins/code/prettify.js', CClientScript::POS_HEAD);
     $cs->registerScript('content', $this->makeOptions(), CClientScript::POS_HEAD);
 }
開發者ID:s-nice,項目名稱:24int,代碼行數:12,代碼來源:KindEditor.php

示例14: init

 public function init()
 {
     parent::init();
     Yii::import('bootstrap.behaviors.TbWidget');
     $this->attachBehavior('tbWidget', new TbWidget());
     if (!isset($this->assetPath)) {
         $this->assetPath = realpath(dirname(__FILE__) . '/../assets');
     }
     if (!$this->bindPlugin) {
         $this->htmlOptions['data-plugin'] = 'datetimepicker';
         $this->htmlOptions['data-plugin-options'] = CJSON::encode($this->pluginOptions);
     }
 }
開發者ID:nkovacs,項目名稱:yiistrap-datetimepicker,代碼行數:13,代碼來源:TbDateTimePicker.php

示例15: init

 public function init()
 {
     if (!isset($this->options['allowTimes'])) {
         $this->options['allowTimes'] = array();
         for ($i = 0; $i < 24; $i++) {
             $hour = str_pad($i, 2, 0, STR_PAD_LEFT);
             $minutes = str_pad($i, 2, 0, STR_PAD_LEFT);
             $this->options['allowTimes'][] = $hour . ':00';
             $this->options['allowTimes'][] = $hour . ':30';
         }
     }
     return parent::init();
 }
開發者ID:blogfor,項目名稱:activity,代碼行數:13,代碼來源:jqueryDateTime.php


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