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…
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.…
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,…
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…
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' =>…
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…
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…
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…
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…
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…
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.…
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…