本文整理汇总了PHP中yii\base\Widget::begin方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::begin方法的具体用法?PHP Widget::begin怎么用?PHP Widget::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\base\Widget
的用法示例。
在下文中一共展示了Widget::begin方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: begin
public static function begin($config = [])
{
$widget = parent::begin($config);
//Когда виджет рендерится вместе с контентом то используется собственный элемент
// $widget->element = '#' . $widget->options['id'];
return $widget;
}
示例2: begin
public static function begin($config = [])
{
$defaults = ArrayHelper::remove($config, 'defaults', []);
$w = parent::begin($config);
$w->defaults = ArrayHelper::merge($w->defaults, $defaults);
$view = $w->getView();
echo Html::beginForm($w->action, $w->method, ArrayHelper::merge(ArrayHelper::getValue($config, 'options', []), ['id' => $w->id, 'method' => 'POST', 'enctype' => 'multipart/form-data']));
KnockoutAsset::register($view);
// client side validate on submit
if ($w->validateOnSubmit) {
$view->registerJs(sprintf(<<<EOD
\$('#%1\$s').submit(function(e) {
var vm = ko.dataFor(e.target);
if (vm && vm.validate) {
vm.validate();
}
if (vm && vm.isValid && vm.isValid()) {
return true;
} else {
e.preventDefault();
return false;
}
})
EOD
, $w->id, Json::encode($w->defaults)), View::POS_END);
}
// $view->registerJs(sprintf(<<<EOD
// var %1\$s = $.extend({}, x1.config, %2\$s);
// EOD
// , lcfirst(\yii\helpers\Inflector::camelize($w->id)), Json::encode($w->defaults)));
return $w;
}
示例3: begin
/**
* @inheritdoc
* @throws \Exception
*/
public static function begin($config = [])
{
$tree = parent::begin($config);
if (!$tree->nodes) {
throw new \Exception('Node is not found');
}
return $tree;
}
示例4: begin
/**
* @inheritdoc
*/
public static function begin($config = [])
{
static::$raw = true;
parent::begin($config);
}
示例5: begin
/**
* @inherit doc
*/
public static function begin($config = [])
{
$config = self::getConfig($config);
return parent::begin($config);
}
示例6: begin
public static function begin($config = [])
{
$tthis = parent::begin($config);
echo Html::tag('header', $tthis->renderLogo() . Html::tag('ul', Html::tag('li', Html::tag('a', $tthis->options['menuLabel'] . Html::tag('span'), ['class' => 'cd-nav-trigger', 'href' => '#cd-primary-nav'])), ['class' => 'cd-header-buttons']), $tthis->options['headerOptions']), '<main class="cd-main-content">';
}
示例7: begin
/**
* @param array $config
* @return ActiveForm
*/
public static function begin($config = [])
{
/** @var $widget static */
$widget = parent::begin($config);
return $widget->form;
}
示例8: begin
public static function begin($config = array())
{
parent::begin($config);
}
示例9: begin
public static function begin($config = [])
{
self::$config = ArrayHelper::merge(self::$config, $config);
self::$config['id'] = uniqid('modal_');
parent::begin();
}
示例10: begin
public static function begin($config = [])
{
ob_start();
return parent::begin($config);
}
示例11: begin
/**
* Start widget by calling ob_start(), caching all output to output buffer
* @see \yii\base\Widget::begin()
*/
public static function begin($config = [])
{
$widget = parent::begin($config);
ob_start();
return $widget;
}