Questions tagged [yii-widgets]

Components for the PHP-based yii framework

64 questions
1
vote
1 answer

Yii: Update content widget with ajax

I have build a notification widget in Yii framework which is called every page and gives the user notifications. Now I would like to update those notifications automatically every 10 seconds with Ajax. The structure is as follows:
Shark
  • 216
  • 4
  • 14
1
vote
1 answer

YII widget access model - I need a value from DB in my layout

In a layout I need to display number of notifications. what is the right way of doing it? I'm thinking to create a widget for it but is accessing DB while rendering view correct?
Arek S
  • 4,239
  • 4
  • 24
  • 33
1
vote
2 answers

How to put default value in CJuidatepicker in Yii?

I have the code below to display a calendar input in Yii form. widget('zii.widgets.jui.CJuiDatePicker', array( 'name' => 'publish_date', 'attribute' => 'publish_date', 'model'=>$model, …
hd.
  • 17,596
  • 46
  • 115
  • 165
1
vote
2 answers

Yii2 how to set the title for the widget ListView

I have installed in Yii 1.1 $this->widget('zii.widgets.CListView', array( 'template' => Yii::t('Site','Header News') But how 'to do it in Yii2 ? echo ListView::widget(['template' => Yii::t('Site','Header News'), 'dataProvider' => $tipsList, …
itcoder
  • 187
  • 1
  • 5
  • 17
1
vote
1 answer

Using Controller method from a widget's view in Yii

I have a simple task that I want to achieve - I have a navbar widget and I want to add "active" class to links that leading to the currently displayed page. Cetver's answer @ Yii how to highlight the current menu item gives me a pretty method that I…
muszek
  • 447
  • 6
  • 15
0
votes
0 answers

Initial submit filter of DateRangePicker widget in Yii2

I have a problem with DateRangePicker. If attribute firstly It is empty , I dont select current day. But If was select another day and it work, then I select today It work. How can I select today in first time. Is it possible ?
0
votes
1 answer

Can some one help me in Error YiiWidget (v1)

I don't. understand where is error in my code. But I think in init() function! var_dump ($this->newsType()); No method or closure named "my" was found in the NewsStream class and its behaviors. This is NewsStream.php (widget class) public function…
0
votes
1 answer

Getting Undefined variable model in yii2 while using Listview

The ListView widget is used to display data from a data provider. Each data model is rendered using the specified view file.I am using this function to pass data to the view. A typical usage is as follows: use yii\widgets\ListView; use…
alan54
  • 23
  • 4
0
votes
1 answer

Yii 1.1.21 : is it possible to create two dropdown buttons in the same button group?

I am new to Yii, and I have been LOOKING for documentation on Yii and CMenu. I have used Phalcon and various other frameworks with similar options, but Yii's menu engine is new to me. I am trying to create a button menu with two drop down menu…
UnKulMunki
  • 15
  • 7
0
votes
1 answer

Yii CGridView change controller name (for generating urls)

I have a view displaying company details, and I added a list of orders made by this company (separate model and controller). Everything works, however the CGridView that is used to display the list of orders is rendered (renderPartial()) from the…
AJ Cole
  • 169
  • 2
  • 13
0
votes
0 answers

Yii2 widget rendering (Redactor, translation not working)

I am having trouble getting translations to work. [https://imperavi.com/redactor/ Version 3, Yii 2.0.12, PHP 7.1.16] Here is my code in yii2 (php framework): use yii\easyii\widgets\Redactor; use yii\widgets\ActiveForm; ... field($model,…
aalesund
  • 313
  • 1
  • 4
  • 13
0
votes
2 answers

Yii2: How to use map() to show two fields in a Select2?

I am using a Select2 widget for Yii2. It shows a list with the ids of the users. I need to show two fields defined in my model called Users: first_name_user and last_name_user. Like this: Daniel Gates John Connor John Doe Maria Key But I don't know…
Roby Sottini
  • 2,117
  • 6
  • 48
  • 88
0
votes
1 answer

Class 'kartik\base\InputWidget' not found

In my Yii2 apps I add extension select2, since composer not successfully downloaded all the needed librarys. So I do it manually but I have still have error. Any help is BIG THANKS. Here is my error.
Dulf
  • 13
  • 7
0
votes
1 answer

How to show records in section with heading from activeDataProvider in yii2

My database structure is as follows id : item : name : price 1 : framework : bootstrap : 90 1 : framework : zend : 100 1 : framework : drupal : 150 1 : responsive : no : 0 1 : responsive : yes : 50 I want to render…
Arif Sami
  • 307
  • 1
  • 2
  • 14
0
votes
0 answers

Using Unclead's yii2-multiple-input issue with radio buttons

I have an issue with Unclead's yii2-multiple-input widget i'm using the multi column to add an input field with a radio button when i add a row then it create a input field with a radio button and due to different name they all radios behave like…