本文整理汇总了PHP中CInputWidget类的典型用法代码示例。如果您正苦于以下问题:PHP CInputWidget类的具体用法?PHP CInputWidget怎么用?PHP CInputWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CInputWidget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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 = Yii::getPathOfAlias('lib.bootstrap-wysihtml5');
}
if (!$this->bindPlugin) {
$this->htmlOptions['data-plugin'] = 'wysihtml5';
$this->htmlOptions['data-plugin-options'] = CJSON::encode($this->pluginOptions);
}
TbHtml::addCssStyle('width: ' . $this->width . 'px; height: ' . $this->height . 'px;', $this->htmlOptions);
}
开发者ID:juanprua,项目名称:yiistrap-widgets,代码行数:17,代码来源:TbWysihtml5.php
示例17: init
/**
* Init widget
*/
public function init()
{
parent::init();
if ($this->assetsPath === null) {
$this->assetsPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
}
if ($this->assetsUrl === null) {
$this->assetsUrl = Yii::app()->assetManager->publish($this->assetsPath);
}
if ($this->selector === null) {
list($this->name, $this->id) = $this->resolveNameId();
$this->selector = '#' . $this->id;
}
$this->registerClientScript();
}
开发者ID:Telemedellin,项目名称:tm,代码行数:18,代码来源:ERedactorWidget.php
示例18: init
/**
* Init widget.
*/
public function init()
{
parent::init();
if ($this->selector === null) {
list($this->name, $this->id) = $this->resolveNameID();
$this->htmlOptions['id'] = $this->getId();
$this->selector = '#' . $this->getId();
if ($this->hasModel()) {
echo CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
} else {
echo CHtml::textArea($this->name, $this->value, $this->htmlOptions);
}
}
$this->registerClientScript();
}
开发者ID:sepaker,项目名称:yupe,代码行数:18,代码来源:ImperaviRedactorWidget.php
示例19: init
public function init()
{
// Please change the config below to suit your needs
$this->uploadPath = dirname(Yii::app()->request->scriptFile) . '/uploads/';
$this->uploadUrl = Yii::app()->getRequest()->hostInfo . Yii::app()->baseUrl . '/uploads/';
// We need to make the CKFinder accessible, let's publish it to the assets folder
$lo_am = new CAssetManager();
$this->path = Yii::app()->getAssetManager()->publish(Yii::app()->basePath . '/extensions/finder/ckfinder2.1', true);
// And save the upload path to use with ckfinder's config file. Passing as js param did not work...
$lo_session = new CHttpSession();
$lo_session->open();
$lo_session['auth'] = true;
$lo_session['upload_path'] = $this->uploadPath;
$lo_session['upload_url'] = $this->uploadUrl;
parent::init();
}
开发者ID:nctruong,项目名称:inputen,代码行数:16,代码来源:EImageFinder.php
示例20: init
public function init()
{
parent::init();
if ($this->selector === null) {
list($this->name, $this->id) = $this->resolveNameID();
$this->htmlOptions['id'] = $this->getId();
$this->selector = '#' . $this->getId();
if ($this->hasModel()) {
echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
} else {
echo CHtml::textField($this->name, $this->value, $this->htmlOptions);
}
}
$this->registerMoment();
$this->registerBootstrapDateRangePicker();
}
开发者ID:chervand,项目名称:yii-bootstrap-daterangepicker,代码行数:16,代码来源:BootstrapDateRangePicker.php
注:本文中的CInputWidget类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论