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
1
vote
1 answer

Yii Framework - CHtml

I'm new to the Yii Framework. In fact, it was dumped on my lap last week. On the email confirmation I need to print "number" of posts. For example, 3 posts. The problem I'm not sure how to count the posts and print it on the confirmation. Do I…
user4543794
1
vote
1 answer

Yii Framework ERROR 404 -Could not resolve the requisition "pdfs/andre.pdf"

Greetings, I have a folder with many pdf files. What i want is to be able to generate links in a view, and when i click one of those links the browser render's the file. In last case, at least the browser downloads the file to the hard-drive.…
André Castro
  • 1,527
  • 6
  • 33
  • 60
1
vote
1 answer

Yii: CHtml image link - how to get to the image in one table through relation in other table?

I'm trying to display link to an album/view through image that belongs to that album. I have my model 'Album' and there I have the relation with my 'Photo' model, which represents table where pictures are saved(or to be more accurate-picture names,…
1
vote
1 answer

Run function inside CHtml::listData - yii

I am trying to list values from a treview in a dropdown list, in Yii. So, i already have a function to concatenate the treeview in path like (example primary\secondary\terciary. I call this function passing the ID from the data and the function…
1
vote
1 answer

How to use CHtml's link function without linking to 'index'?

I'm using the CHtml::link() function, and I have a problem with the index action. The code in view: echo CHtml::link('Watch it', array('video/index', 'id' => $id)); The urlManager part in config: 'urlManager' => array( 'urlFormat' =>…
1
vote
1 answer

Do I need to use CHtml::encode at TbDetailView?

I'm using Yii as PHP Framework and when I need to display some information from database, I'm always using CHtml::encode to improve security. My question is: Do I need to do the same when I display values at Yii widgets, such as TbDetailView or…
1
vote
1 answer

CHtml::radioButtonList validation in Yii

Im using Chtml for one of my form in my Yii project. I have implemented radioButton in that form , i.e null));?> how can I do validation for this?
pinku
  • 1,139
  • 2
  • 9
  • 25
1
vote
1 answer

Passing variable along Chtml button in Yii

Iam trying to pass variable along with Chtml button in Yii using the following code echo CHtml::button('Update', array('submit' => array('serviceRequest/Update',array('id'=>$requestId)))); But it is showing 404 error due to the url problem. On…
anu
  • 458
  • 2
  • 13
  • 36
1
vote
1 answer

Chtml Cmaskedtextfield Do Not Send Any Value?

I have CMaskedTextField in my form, when i fill it, the $_POST[] do not return any value for it!? widget('CMaskedTextField', array( …
shgnInc
  • 2,054
  • 1
  • 23
  • 34
1
vote
1 answer

How can I integrate a simple bootstrap-button within Yii (via CHtml) without any extensions?

How could I do that with CHtml (this works within Yii too) ? I've tried the following without success: echo…
user3025289
1
vote
1 answer

yii -> dropDownList -> CHtml::listData -> set selected value

How can I set the selected value in the following statement: echo $form->dropDownList( $model, 'land_id', CHtml::listData(ListeLand::model()->findAll(), 'iso', 'landname'), array('class'=>'span4 chosen','maxlength'=>20) ); I want to…
user2227400
1
vote
3 answers

Multiple _form views on a single create view [Yii]

I'm trying to merge 3 models to create a fourth one. I have model1, model2 and model3 and I want to merge them into modelMaster. I've also created controllers for all of them. When I call modelMaster/create action, I render the modelMaster/create…
acidghost
  • 484
  • 4
  • 14
0
votes
0 answers

What's alternative for CHtml::ajaxSubmitButton in Yii2?

I really need your help. I'm new at it, so i dont get this thing. I have old project on Yii1, there is an ajax submit button. I thought that i can use this button in Yii2 but I've rear that Yii2 doesnt use CHtml. So here's my question, what can i do…
0
votes
1 answer

How to set a value in CHtml::textArea in yii

In my web application, I want to set a default value to CHtml::textArea. In my view, 6, 'cols' => 50, 'class' => "form-control",'value'=>$exam->answer)); ?> But, this is not working.…
Arya
  • 504
  • 2
  • 8
  • 31
0
votes
1 answer

Yii - linking to static page of a given model id

Each model id has a corresponding static page e.g id = 1 of my table has a static page in my views as 1.php. So when i click the link button (implemented in ClistView) it respective static page should be displayed. How can i implement this…
Femme Fatale
  • 870
  • 7
  • 27
  • 56