Questions tagged [yii-widgets]

Components for the PHP-based yii framework

64 questions
35
votes
7 answers

Hide label for input field

I am trying to hide the label for a specific field in _form.php without success. I have tried couple of variation like, but none is working: field($model, 'sample_text')->textArea('label'=>false) ?> and alternate code:
Joshi
  • 2,730
  • 5
  • 36
  • 62
26
votes
5 answers

Create button with link in Yii2

I am trying to setup a button with a link to a view. However yii\bootstrap\Button does not have a property url. I would rather use Yii as supposed to just use flat out php. The code as below would be the ideal situation, but since the url option…
Wijnand
  • 1,192
  • 4
  • 16
  • 28
24
votes
6 answers

How to add class to ActiveForm in Yii 2.0 framework?

I'd like to add a class to the form like:
How should I rewrite this for Yii 2.0 ActiveForm class? The same question is for this structure inside of the form tag:
Павел Иванов
  • 1,863
  • 5
  • 28
  • 51
6
votes
3 answers

Split ActiveForm fields into different tabs with Tabs widget

I'm creating a form view and I want to organize the form fields with tabs structure, using the official Tabs widget. Is it possible init the Tabs widget with the id (or class) of the div elements that contains the active form fields?
AleCat83
  • 1,443
  • 3
  • 22
  • 41
5
votes
1 answer

Yii2 dosamigos Ckeditor Language Direction

In Yii2 Ckeditor , I am using use dosamigos\ckeditor\CKEditor; this extension for showing ckeditor in form field($model, 'cmsdetails_ar')->widget(CKEditor::className(), [ 'options' => ['rows' => 6], 'preset' =>…
Biju s
  • 420
  • 1
  • 7
  • 16
4
votes
2 answers

YII2 add colspan in gridview header

How to add a colspan in a header in gridview?? Normally a header looks like this... …
beginner
  • 2,024
  • 5
  • 43
  • 76
3
votes
1 answer

Render string in 'label' of Yii2 Bootstrap widget as HTML

I'm using Yii2's Bootsrap Tabs widget (yii\bootstrap\Tabs -- http://www.yiiframework.com/doc-2.0/yii-bootstrap-tabs.html) I want to insert HTML tags as the value of the label key in the array that builds this widget. I tried including the key =>…
Sam Malayek
  • 3,595
  • 3
  • 30
  • 46
3
votes
1 answer

Yii widget called in component

Is it considered bad practice to call a Yii widget such as $this->widget('application.extensions.qrcode.QRCodeGenerator', array( 'data' => $this->data, 'subfolderVar' => true, 'matrixPointSize' => 5, )); from within a component or…
anna
  • 585
  • 1
  • 6
  • 22
2
votes
1 answer

How to add Multiple Yii2 submenuTemplate in one Menu::widget?

I am creating a web application based on yii2 and learn-plus dashboard theme, the collapsible sidebar navigation menu has been implemented with an id that acts as a targeted link (#menu_id) for the menu to open when parent link is clicked, Now I am…
Daud Mabena
  • 23
  • 1
  • 9
2
votes
1 answer

Yii alert widget

In view I have widget: if ($content): echo Alert::widget([ 'options' => [ 'class' => 'alert-info', ], 'body' => $content, ]); endif; That widget I want render not always, for…
Wizard
  • 10,985
  • 38
  • 91
  • 165
2
votes
2 answers

Yii 2.0 Getting data from model without widget

Can anyone give me sample of how to retrieve data from model without having to use Widget ? Because need to get data per table column and put them inside my own view (not using widget) Controller : public function actionIndex() { …
Karate_Dog
  • 1,265
  • 5
  • 20
  • 37
2
votes
2 answers

Yii2 include assets after code generated by widget

How to include my .js files after javascript code generated by Datepicker widget in view file. echo DatePicker::widget([ 'name' => 'datepicker--2', 'id' => 'datepicker--2', 'clientOptions'…
user1561346
  • 502
  • 3
  • 13
  • 28
2
votes
2 answers

How do I add a class name to pager attribute in Yii's widget?

This is my table in Yii: $this->widget('GridView', array( 'dataProvider' => $users, 'itemsCssClass'=>'table', 'pager' => array( 'class' => 'CLinkPager', 'prevPageLabel' =>…
Jozsef Naghi
  • 1,085
  • 3
  • 14
  • 32
2
votes
1 answer

YII: How to register a yiiwheels widget assets without calling the widget

I use Yiiwheels. I want to change a combo box to select 2 widget, but the pertinent assets are not loaded yet. The ugly solution is creating a dummy select2 element in a hidden span, so assets are loaded automatically. but is there any better way to…
hpaknia
  • 2,769
  • 4
  • 34
  • 63
2
votes
1 answer

Yii Bootstrap TbGridView

For some reason my filtering isn't working correctly inconjunction with the pager on my Yii site, I have the following view which uses the Yii Bootstrap TbGridView widget to display some tabular data and have the ability to filter on different…
Zabs
  • 13,852
  • 45
  • 173
  • 297
1
2 3 4 5
Header1 Header2 Header3