Put attention of the question answer form
Put attention of the question answer form
Often happens to have the need of change a part of the page with ajax.
If you like the things to be short and clear, then you can skip right to a short summary of instructions at the end of this article.
My article Display the full record in a CJuiDialog uses ajax to view a record in dialog on clicking the 'view-icon'.
We often need to display a success page after the user has submitted a form without problem. We may show some welcome message after a user registers a new account. There are many ways to implement this workflow. In this article, I will explain a method that exploits flash messages.
Let's see what exactly are the events in Yii!
I've seen many tickets regarding how to show friendly delete confirmation using CGridView's CButtonColumn in ajax request. If you are using relational database, after producing CRUD functionality when you try to delete a record in ajax mode which has child record it can't be deleted and you can see the ajax loader forever. By this way you can't show the users if a record has been successfully dele...
If we want to set meta tags on a per page (controller-action) basis, we may use the clientScript application component.
I discovered Twitter Bootstrap almost two years ago. After trying it out for a while I fell in love with it. It didn't take long before I realized that it would be great to write an extension that allowed developers to start using Bootstrap in their Yii projects. One night I sat down and started writing what later became my now popular [bootstrap extension](http://ww...
Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).
Add these lines in /config/main.php
'components'=>array(
.........
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=database1',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'itsasecret',
'charset' => 'utf8',
),
'db2'=>array(
'class' => 'CDbConnection',
'connectionString' => 'mysql:host=localhost;dbname=databa...
This is what I did. Its the EASIEST solution that I know of. I just reused the advanced search done in CGridView.
In this wiki I will show how could use a TbActiveForm for changing the old password with help of old, new and repeat password features.
Gii provides us normally with the following code on the 'actionCreate':
public function actionCreate()
{
$model=new ModelName;
This is a shortcut for adding a text search for multiple values i.e.
This wiki shall be considered deprecated since the Yii installer for composer has been discontinued.
Lets say we have such a CGridView widget showing a list of users for administrator. Users have status „active“ or „disabled“. Grid widget puts class „odd“ or „even“ to rows and we want to preserve this. So we want to add a class „disabled“ to rows with disabled users.
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'user-grid',
'dat...
will generate twitter bootstrap styled breadcrumb code:
I normally create a files
folder and I allocate it within my www
one, that is where I keep my css, js, images files. So, even though you can place it where ever you wish and for the sake of the example, I will use the files
folder name.
There are a couple of ways to achieve this, but the first is preferred.