本文整理汇总了PHP中CInputWidget::init方法的典型用法代码示例。如果您正苦于以下问题:PHP CInputWidget::init方法的具体用法?PHP CInputWidget::init怎么用?PHP CInputWidget::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInputWidget
的用法示例。
在下文中一共展示了CInputWidget::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'source';
$this->baseurl = Yii::app()->getAssetManager()->publish($dir);
$this->kcFinderPath = $this->baseurl . "/kcfinder/";
parent::init();
}
示例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);
}
}
示例3: init
/**
* Initialize the widget
*/
public function init()
{
//Publish assets
$this->publishAssets();
$this->registerClientScripts();
parent::init();
}
示例4: init
public function init()
{
parent::init();
if (empty($this->model) || empty($this->attribute)) {
throw new Exception("Model and Attribute must be declared");
}
}
示例5: init
public function init()
{
list($this->name, $this->id) = $this->resolveNameID();
//не стал делать сеттер, если хочешь допиши
$this->attachBehaviors($this->behaviors());
parent::init();
}
示例6: 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();
}
示例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);
}
示例8: 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');
}
}
示例9: 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();
}
示例10: 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();
}
示例11: 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);
}
}
示例12: 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);
}
示例13: 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();
}
示例14: 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();
}
示例15: init
public function init()
{
$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'source';
$this->baseurl = Yii::app()->getAssetManager()->publish($dir);
$cs = Yii::app()->clientScript;
$cs->registerCoreScript('jquery');
$cs->registerCoreScript('jquery.ui');
$cs->registerScriptFile($this->baseurl . "/jquery.tmpl.min.js");
$cs->registerScriptFile($this->baseurl . "/jquery.iframe-transport.js");
$cs->registerScriptFile($this->baseurl . "/jquery.fileupload.js");
$cs->registerScriptFile($this->baseurl . "/jquery.fileupload-ui.js");
$cs->registerScriptFile($this->baseurl . "/application.js");
$cs->registerCssFile("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css", "screen");
$cs->registerCssFile($this->baseurl . "/jquery.fileupload-ui.css", "screen");
parent::init();
}