Size: a a a

2020 April 20

T

TradersVE in Yii Framework 3
Дмитрий
А оно обоснованно длиннее чем на yii2?
<?= FieldBuilder::widget()
   ->withForm($form)
   ->form($model)
   ->attribute('login')
   ->autofocus(true)
   ->placeHolder('login')
   ->tabindex('1')
   ->label('Login:')
   ->textInput()
?>

<?= FieldBuilder::widget()
   ->withForm($form)
   ->form($model)
   ->attribute('login')
   ->label('Login:')
   ->textInput([
        'autofocus' => true,
        'placeholder' => 'Login: ',
        'tabindex' => '1'
   ])
?>

It equals yii2 just add the withForm() method.
источник

Д

Дмитрий in Yii Framework 3
TradersVE
<?= FieldBuilder::widget()
   ->withForm($form)
   ->form($model)
   ->attribute('login')
   ->autofocus(true)
   ->placeHolder('login')
   ->tabindex('1')
   ->label('Login:')
   ->textInput()
?>

<?= FieldBuilder::widget()
   ->withForm($form)
   ->form($model)
   ->attribute('login')
   ->label('Login:')
   ->textInput([
        'autofocus' => true,
        'placeholder' => 'Login: ',
        'tabindex' => '1'
   ])
?>

It equals yii2 just add the withForm() method.
It's hard to add syntax sugar like in yii2 : $form->field ... ?
источник

AM

Alexander Makarov in Yii Framework 3
Nope, should not be hard.
источник

T

TradersVE in Yii Framework 3
well in yii2 the ides do not give a suggestion of methods, in yii3 yes.
источник

T

TradersVE in Yii Framework 3
@yiiliveext they are silent
источник

Д

Дмитрий in Yii Framework 3
TradersVE
well in yii2 the ides do not give a suggestion of methods, in yii3 yes.
How to add custom widget ?
источник

DS

Dmitriy S in Yii Framework 3
Фигасе, только отошел, а тут уже нефтью торгуют😬
источник

T

TradersVE in Yii Framework 3
Дмитрий
How to add custom widget ?
inside the form?
источник

Д

Дмитрий in Yii Framework 3
TradersVE
inside the form?
İnside and outside. I'm just asking because don't know how
источник

T

TradersVE in Yii Framework 3
Дмитрий
İnside and outside. I'm just asking because don't know how
its very simple:

<?= FormBuilder::begin() ?>
   <?= Custom::widget ?>
<?= FormBuilder::end() ?>

or

<?= Form::begin() ?>
   <?= Custom::widget() ?>
<?= Form::end() ?>
источник

T

TradersVE in Yii Framework 3
you can use the constructor or it is not your decision.
источник

T

TradersVE in Yii Framework 3
outside <?= Custom::widget() ?>
источник

Д

Дмитрий in Yii Framework 3
I see
источник

T

TradersVE in Yii Framework 3
the form are so flexible that you can only use the class.
источник
2020 April 21

Д

Дмитрий in Yii Framework 3
TradersVE
the form are so flexible that you can only use the class.
Ok, I'm just curious , can we also have ability to use it like this : $form->model($model)->attribute('someattr') ... ?
источник

T

TradersVE in Yii Framework 3
Дмитрий
Ok, I'm just curious , can we also have ability to use it like this : $form->model($model)->attribute('someattr') ... ?
\\ Yii3
<?= FieldBuilder::widget()
   ->withForm($form)
   ->form($model)
   ->attribute('login')
   ->autofocus(true)
   ->placeHolder('login')
   ->tabindex('1')
   ->label('Login:')
   ->textInput()
?>

\\ Yii2
<?= $form->field($model, 'login')
   ->textInput([
     'autofocus' => true,
       'placeholder' => \Yii::t('app.user', 'Login'),
       'required' => (YII_ENV === 'test') ? false : true,
       'tabindex' => '1',
   ])
   ->label(\Yii::t('app.user', 'Login'))
?>
источник

T

TradersVE in Yii Framework 3
it is exactly the same.
источник

RT

Roman Tsurkanu in Yii Framework 3
Alexander Makarov
Если тебе нравится подход там, то давай сделаем.
вот до такого примерно функционала предалагаю упростить https://github.com/romkatsu/yii2-collection/blob/redesign_draft/src/Collection.php
источник

AM

Alexander Makarov in Yii Framework 3
Там всё ещё много Array-only методов, насколько я вижу...
источник

RT

Roman Tsurkanu in Yii Framework 3
Alexander Makarov
Там всё ещё много Array-only методов, насколько я вижу...
например?
источник