i have learned how to upload image in the database in this wiki "http://www.yiiframework.com/wiki/2/". i have uploaded it in the in database successfully.
but i dono how to display image . it displays only the name of image
Hello and welcome to the framework. You should really try to read "The Definitive Guide to Yii" and understand, if not all then most of it. If you did that you would probably be able to create this yourself, or you should be able to search and understand the work of others.
But now, because i’m such a nice guy, i will give an idea to how it could be made (i’m not sure of it, and i haven’t tested it)
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('*'),
)
}
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('create','update'),
'users'=>array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin','delete'),
'users'=>array('admin'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}