本文整理汇总了PHP中CInputWidget::run方法的典型用法代码示例。如果您正苦于以下问题:PHP CInputWidget::run方法的具体用法?PHP CInputWidget::run怎么用?PHP CInputWidget::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInputWidget
的用法示例。
在下文中一共展示了CInputWidget::run方法的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);
}
示例2: 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;
}
示例3: 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);
}
示例4: 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);
}
示例5: 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);
}
示例6: run
public function run()
{
parent::run();
list($name, $id) = $this->resolveNameID();
$assets = Yii::app()->getAssetManager()->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets');
$options = $this->makeOptions();
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($assets . '/ckeditor.js');
$this->htmlOptions['id'] = $id;
$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;
}
示例7: run
/**
* Init widget
*/
public function run()
{
parent::run();
list($name, $id) = $this->resolveNameID();
$baseDir = dirname(__FILE__);
$assets = Yii::app()->getAssetManager()->publish($baseDir . DIRECTORY_SEPARATOR . 'markitup' . DIRECTORY_SEPARATOR . 'markitup');
$cs = Yii::app()->getClientScript();
$widgetPath = Yii::getPathOfAlias('widgets.markitup.markitup.markitup.sets.' . $this->editorType);
$cs->registerScriptFile($assets . '/jquery.markitup.js', CClientScript::POS_END);
$cs->registerScriptFile($assets . '/sets/' . $this->editorType . '/set.js', CClientScript::POS_END);
$cs->registerCssFile($assets . '/skins/simple/style.css');
$cs->registerCssFile($assets . '/sets/' . $this->editorType . '/style.css');
if ($this->hasModel()) {
$html = CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
} else {
$html = CHtml::textArea($name, $this->value, $this->htmlOptions);
}
$js = "\$('#{$id}').markItUp(mySettings);";
$cs->registerScript('Yii.' . get_class($this) . '#' . $id, $js, CClientScript::POS_READY);
echo $html;
}
示例8: run
/**
* 运行
*/
public function run()
{
parent::run();
$assets = $this->getAssetsPath();
$clientScript = Yii::app()->getClientScript();
$clientScript->registerCssFile($assets . '/themes/default/default.css');
$clientScript->registerScriptFile($assets . '/kindeditor-min.js', CClientScript::POS_END);
$clientScript->registerScriptFile($assets . '/lang/' . $this->language . '.js', CClientScript::POS_END);
$clientScript->registerScript('content', $this->makeOptions(), CClientScript::POS_END);
}
示例9: run
public function run()
{
parent::run();
$this->widget('bootstrap.widgets.TbCKEditor', array('model' => $this->model, 'attribute' => $this->attribute, 'editorOptions' => $this->options));
}
示例10: run
public function run()
{
parent::run();
$assets = $this->assets;
// here any option is overriden by user's options
list($name, $id) = $this->resolveNameID();
$options = $this->makeOptions();
$cs = Yii::app()->getClientScript();
$this->htmlOptions['id'] = $id;
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;
}
$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;
}
示例11: run
public function run()
{
parent::run();
list($name, $id) = $this->resolveNameID();
$baseDir = dirname(__FILE__);
$assets = Yii::app()->getAssetManager()->publish($baseDir . DIRECTORY_SEPARATOR . 'assets');
$options = $this->makeOptions();
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($assets . '/ckeditor/ckeditor.js');
$cs->registerScriptFile($assets . '/AjexFileManager/ajex.js');
$cs->registerScriptFile($assets . '/clone.js');
$this->htmlOptions['id'] = $id;
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;
}
$js = <<<EOP
CKEDITOR.ELEMENT_MODE_REPLACE=true;
var ckeditor = CKEDITOR.replace('{$name}',{$options});
var {$id}_afm=clone(AjexFileManager);
{$id}_afm.init({
\treturnTo: 'ckeditor',
\teditor: ckeditor,
\tpath: '{$assets}/AjexFileManager/',
});
EOP;
$cs->registerScript('Yii.' . get_class($this) . '#' . $id, $js, CClientScript::POS_LOAD);
Yii::app()->clientScript->registerScript('Yii.' . get_class($this) . '#' . $id, "var CKEDITOR_BASEPATH='{$assets}/ckeditor/'", CClientScript::POS_BEGIN);
if ($this->hasModel()) {
$html = CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
} else {
$html = CHtml::textArea($name, $this->value, $this->htmlOptions);
}
echo $html;
}
示例12: run
/**
* Run the widget
*/
public function run()
{
parent::run();
}
示例13: run
public function run()
{
parent::run();
list($name, $id) = $this->resolveNameID();
$baseDir = dirname(__FILE__);
$assets = Yii::app()->getAssetManager()->publish($baseDir . DIRECTORY_SEPARATOR . 'assets');
$options = $this->makeOptions();
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($assets . '/ckeditor.js');
$cs->registerScriptFile($assets . '/ckfinder/ckfinder.js');
$this->htmlOptions['id'] = $id;
// $this->htmlOptions['fmt'] = 'fck';
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;
}
$js = <<<EOP
function loadCKE_{$id}(){
CKEDITOR.replace('{$name}',{$options});
}
CKFinder.setupCKEditor(CKEDITOR, '{$assets}/ckfinder/');
EOP;
//$cs->registerScript('Yii.'.get_class($this).'#'.$id, $js, CClientScript::POS_LOAD);
if ($this->onLoad) {
$cs->registerScript('Yii.' . get_class($this) . '#' . $id, $js . "loadCKE_" . $id . "();", CClientScript::POS_LOAD);
} else {
$cs->registerScript('Yii.' . get_class($this) . '#' . $id, $js, CClientScript::POS_LOAD);
}
if ($this->hasModel()) {
$html = "";
if (!$this->onLoad) {
$html = CHtml::button("Turn on EDITOR", array("onClick" => "loadCKE_" . $id . "();"));
}
$html .= CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
} else {
if (isset($_POST[$name])) {
$this->value = $_POST[$name];
}
$html = "";
if (!$this->onLoad) {
$html = CHtml::button("Turn on EDITOR", array("onClick" => "loadCKE_" . $id . "();"));
}
$html = CHtml::textArea($name, $this->value, $this->htmlOptions);
}
echo $html;
}
示例14: run
public function run()
{
parent::run();
list($name, $id) = $this->resolveNameID();
$baseDir = dirname(__FILE__);
$assets = Yii::app()->getAssetManager()->publish($baseDir . DIRECTORY_SEPARATOR . 'assets');
$options = $this->makeOptions();
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($assets . '/ckeditor.js');
$this->htmlOptions['id'] = $id;
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;
}
if ($this->editorTemplate == 'basic') {
$js = <<<EOP
CKEDITOR.replace('{$name}', { toolbarGroups : [
\t
\t\t{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
\t\t{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
\t\t{ name: 'styles' },
\t\t{ name: 'colors' }],
\t\theight: '{$this->height}'});
EOP;
} else {
$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;
$js_conf = <<<EOP
if(typeof CKEDITOR !== 'undefined') {
\t\t\t\t
\tCKEDITOR.on( 'instanceReady', function( ev ) {
\t\t// Output paragraphs as <p>Text</p>.
\t\tev.editor.dataProcessor.writer.setRules( '*', {
\t\t\tindent: false,
\t\t\tbreakBeforeOpen: true,
\t\t\tbreakAfterOpen: false,
\t\t\tbreakBeforeClose: false,
\t\t\tbreakAfterClose: true
\t\t});
\t});
}
EOP;
$cs->registerScript('body', $js_conf, CClientScript::POS_LOAD);
}
示例15: 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->ECKE->replace($id, $this->_config);
}