Welcome, all of you !
Welcome, all of you !
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...
We will use Symfony 2 components for writing tests for Yii project, it's gonna be fun :).
During development, it's often very handy to have SQL logging and profiling.
$this->render('index', array(
'dataProvider' => $dataProvider,
));
`
In this article you will find Yii framework extensions enabling you to add various charts/print out buttons etc. to your webapp.
Usually when we use AutoComplete in a project, We need to show "title" or "name" in the list, while when the form is posted, we need some sort of integer ID referring to the selected value. Out of the Box, CJuiAutoComplete widget doesn't provides different display text and post values.
You have to extend the widget class and configure it for user login widget
}
`
V. The Order model would start with:
class Order extends CActiveRecord
{
const STATUS_INITIATED = 1;
const STATUS_CANCELED = 2;
const STATUS_EXPIRED = 3;
const STATUS_PAID = 4;
public $statuses = array(
self::STATUS_INITIATED => 'Initiated',
self::STATUS_CANCELED => 'Canceled',
self::STATUS_EXPIRED => 'Expired',
self::STATUS_PAID => 'Paid',
);
// more cod...
The Yii Framework is very powerful and it provides a lot of functionality right from the pre-built webapp. One of the nice things that is already established for you as a developer is the Login authentication. While the default configuration simply sets it up to run against an array of hard coded usernames and passwords, the [Yii Blog Tutorial](http://www.yiiframework.com/doc/blog/1.1/en/prototype...
p.s. latest version of this tutorial is always available unter the docs/ folder of the User Management Module.
One of the common requests I see in the forum is how to implement RBAC. While you can implement Yii 2's built-in RBAC, that might be too much for developers who are just starting with Yii 2 or have simpler needs. Sometimes you are looking for a fast solution and just want two flavors, user and admin. And even if you will eventually need more, you can use these methods as a starting point for devel...
This wiki explains how to add calculated fields into your Yii Framework 2.0 gridview with filtering and sorting.
After getting lot's of error and don't know how to perform multiple images api in yii2 finally I get it today
Simple Ajax popup view with Ajax link
Assume we have many categories and many posts.
I found a better solution.
This is a tutorial for how to auto set model values without any code.
Inspired by it I extended the CButtonColumn class like this: