Questions tagged [yii-chtml]

CHtml is a static class that provides a collection of helper methods for creating HTML views.

CHtml is a static class that provides a collection of helper methods for creating HTML views.

52 questions
16
votes
4 answers

multi model forms in yii

How to create a multi-model form in Yii? I searched the entire documentation of Yii, but got no interesting results. Can some one give me some direction or thoughts about that? Any help will be appreciable.
NewUser
  • 12,713
  • 39
  • 142
  • 236
3
votes
1 answer

Input Arabic language with input text in CHtml form in Yii 1.x return unknown characters

I have the following view-code for search key input from user: createUrl('home/search'),'get',array('accept-charset'=>'UTF-8', 'enctype'=>'multipart/form-data'));?> …
3
votes
1 answer

add new item to CHtml in yii

I work Yii with doctrine 2. I have a problem, datetime in doctrine 2 is an object of DateTime class, and I can't update it with regular methods of CHtml or form. How can I add new item in CHtml that can handle this situation. --Best Regards Moe Far
Moe Far
  • 2,742
  • 2
  • 23
  • 41
3
votes
5 answers

Need listbox with multiple selection - in yii

I need listbox of multiple selection in yii, i have code of form area but its saving to database as a word "Array" in field, How to handle this problem? how to get back while view and update and grid view also
bala
  • 168
  • 2
  • 3
  • 10
2
votes
1 answer

Class 'CHtml' not found in Gridview in Yii2

I am developing Yii2 application where I want to list orders data in GridView. User can click on order id and will be redirected to another GridView with order details listing. I want to display link with order id to redirect to order details…
user1780370
  • 851
  • 1
  • 17
  • 27
2
votes
1 answer

How to make a dropDownList in Yii?

I have 2 attributes in model jobs, they are tag and category, I want to make a dropDownList that display the value of tag who have category equal 'salary', here is my code: $s= CHtml::listData($model2, 'salary', 'tag'); echo…
Mohammad
  • 3,449
  • 6
  • 48
  • 75
2
votes
1 answer

Chtml link for Dynamic columns in Cgridview - Yii Framework

I am trying to render the Cgridview with dynamic columns using the input dates (columns dynamically starts from from_dt to to_date) , Now i want to give Chtml::link for dynamic columns but i am getting error undefined index : "01" (dynamic columns…
US-1234
  • 1,519
  • 4
  • 24
  • 61
2
votes
2 answers

Yii CHtml::ajaxSubmitButton always submits data in POST method

I came across this problem when I used CHtml::ajaxSubmitButton to submit some of the data as a GET method. No Matter what i try, It always submits data as a POST method. Anything that I might be doing wrong? Here's my code. echo…
melaka
  • 699
  • 7
  • 23
2
votes
1 answer

Yii - creating absolute URLs with CHTML::link()

I've used the CHTML::link() to create links however it doesn't seem to work for absolute URLs My Code: baseUrl.'/images/image.png'), array('/http://www.newsite.com/about/'));?> The link returns the…
Zabs
  • 13,852
  • 45
  • 173
  • 297
1
vote
2 answers

Yii Controller call from a View?

I have a view that has a form. I have a button which calls a controller via Ajax. echo CHtml::submitButton('Generate', array( 'ajax' => array( 'type' => 'POST', 'url' =>…
ivantxo
  • 719
  • 5
  • 18
  • 36
1
vote
1 answer

$htmlOptions is not working in CHtml::dropDownList Yii

I have this implementation of CHtml: findAll(),'sistema_id', 'sistema_nombre'),array('empty' => 'Selecciona un…
1
vote
1 answer

get value of CHtml::activeDropDownList in yii

I have this code all(),…
Malki Mohamed
  • 1,578
  • 2
  • 23
  • 40
1
vote
0 answers

yii dropdown how to stop posting extra values in ajax post

I am working on dependent dropdown in yii but when i send request using ajax it post all form values but i want to post only catid and want to get rid of all extra posting to make it light . below is the code of my view file please tell a way to…
FahadAkram
  • 445
  • 1
  • 5
  • 25
1
vote
3 answers

List to DropDown list in Yii

Please help with this code:
1
vote
1 answer

Yii, set radio button value fetch from database

In Yii, I listed my table which is fetch from database in grid view. 'value'=> 'CHtml::radioButton("set_default",false,array( "value"=>"$data->id", "set"=>"1", "disable"=>"disable", …
1
2 3 4