Jan 5, 2016 10:55
and when I comment the session line it gives me bunch of errors
Jan 5, 2016 10:54
but stuck in session error which is
A session had already been started - ignoring session_start()
Jan 5, 2016 10:54
now its working when I pass static value in user_id
Jan 5, 2016 10:54
$role = livefactory\models\AuthAssignment::find()->where("item_name='Admin' AND user_id='7'")->asArray()->one();
Jan 5, 2016 10:53
did see the both images in my question???
Jan 5, 2016 10:50
-4
Q: Trying to get property of non-object in yii

user3833682I'm using yii framework and I'm new in yii and can't understand the problem in this code, it is giving error in this code and I just attached the image of my code and when I just try to echo '<pre>';print_r($role);echo '</pre>'; it just print code like this can't understand why this is givi...

 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Jan 5, 2016 09:47
can any one help me for my problem...
Jan 5, 2016 09:37
I know codeigniter only in framework
Jan 5, 2016 09:36
yes i know but I'm new in yii and I got the project to configure at my local machine but can't configure it.
Jan 5, 2016 09:34
->asArray()->one() is this the error?
Jan 5, 2016 09:26
so what I have to do now...
Jan 5, 2016 09:24
you can see the difference between first image and second image in my posted question
Jan 5, 2016 09:21
User Sean I tried to print_r or echo but didn't work for me it is printing same php code to the browser...
Jan 5, 2016 09:07
-3
Q: Trying to get property of non-object in yii

user3833682I'm using yii framework and I'm new in yii and can't understand the problem in this code, it is giving error in this code and I just attached the image of my code and when I just try to echo '<pre>';print_r($role);echo '</pre>'; it just print code like this can't understand why this is givi...

Jan 4, 2016 12:59
when I try to print or echo something it show the php code same at the browser you can see the second image in my question
Jan 4, 2016 12:51
see my question please...
Jan 4, 2016 12:50
take a look to link
Jan 4, 2016 12:50
-3
Q: Trying to get property of non-object in yii

user3833682I'm using yii framework and I'm new in yii and can't understand the problem in this code, it is giving error in this code and I just attached the image of my code and when I just try to echo '<pre>';print_r($role);echo '</pre>'; it just print code like this can't understand why this is givi...

Jan 4, 2016 12:50
The Coder gave me this link for my solution
Jan 4, 2016 12:49
not sure
Jan 4, 2016 12:46
Jan 4, 2016 12:44
I also tried in torbrowser but didn't work for me...
Jan 4, 2016 12:43
please give me other link so I can open this link and solve my problem for yii...
Jan 4, 2016 12:40
give me other link...
Jan 4, 2016 12:38
can't open link
Jan 4, 2016 12:35
Surf Safely!


This website is not accessible.


The site you are trying to access contains content that is prohibited for viewership from within Pakistan.

this is the error I'm getting it when I try to open link
Jan 4, 2016 12:33
I'm getting error on link
Jan 4, 2016 12:31
Surf Safely!

This website is not accessible.


The site you are trying to access contains content that is prohibited for viewership from within Pakistan.
Jan 4, 2016 12:10
ok
Jan 4, 2016 12:10
Jan 4, 2016 12:09
ok
Jan 4, 2016 11:32
Hi can anyone help me for this question stackoverflow.com/questions/34589033/…
Jan 4, 2016 11:31
and this is my index.php code
Jan 4, 2016 11:30
This is my authassingment model code
 

 bin

It's a bin, for binning things.
Jan 4, 2016 12:07
$company = livefactory\models\Company::find()->asArray()->one();
$address = livefactory\models\search\Address::companyAddress($company['id']);
$role = livefactory\models\AuthAssignment::find()->where("item_name='Admin' AND user_id='".Yii::$app->user->identity->id."'")->asArray()->one();
if(count($role) > 0){
Yii::$app->params['user_role']= 'admin';
}else{
Yii::$app->params['user_role']= 'guest';
}
Jan 4, 2016 12:07
namespace livefactory\models;

use Yii;

/**
* This is the model class for table "auth_assignment".
*
* @property string $item_name
* @property string $user_id
* @property integer $created_at
*
* @property AuthItem $itemName
*/
class AuthAssignment extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'auth_assignment';
}

/**
* @inheritdoc
*/
public function rules()
{
return [
[['item_name', 'user_id'], 'required'],
[['created_at' ,'user_id'], 'integer'],
Jan 4, 2016 11:31
$company = livefactory\models\Company::find()->asArray()->one();
$address = livefactory\models\search\Address::companyAddress($company['id']);
$role = livefactory\models\AuthAssignment::find()->where("item_name='Admin' AND user_id='".Yii::$app->user->identity->id."'")->asArray()->one();
if(count($role) > 0){
Yii::$app->params['user_role']= 'admin';
}else{
Yii::$app->params['user_role']= 'guest';
}
Jan 4, 2016 11:31
namespace livefactory\models;
use Yii;
class AuthAssignment extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'auth_assignment';
}

/**
* @inheritdoc
*/
public function rules()
{
return [
[['item_name', 'user_id'], 'required'],
[['created_at' ,'user_id'], 'integer'],
[['item_name',], 'string', 'max' => 64],
[['item_name', 'user_id'], 'unique', 'targetAttribute' => ['item_name', 'user_id']]
];
}

/**
* @inheritdoc
*/
public function attributeLabels()
 
Jan 1, 2016 11:48
and this is web's index.php file's code
error_reporting(0);
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/../../livefactory/config/bootstrap.php');
require(__DIR__ . '/../config/bootstrap.php');

$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../livefactory/config/main.php'),
require(__DIR__ . '/../../livefactory/config/main-local.php'),
Jan 1, 2016 11:47
This is my root index.php file's code...
<?php header('Location: /livecrm/web/index.php'); ?>
Jan 1, 2016 11:47
so how can I run this at my local computer...
Jan 1, 2016 11:46
ok
Jan 1, 2016 11:46
any luck...
Jan 1, 2016 11:40
see my updated question please
Jan 1, 2016 11:37
ok
Jan 1, 2016 11:29
So it means that the project is not configure...
Jan 1, 2016 11:28
There isn't any directory called protected or themes in the project...
Jan 1, 2016 11:28
More information about this error may be available in the server error log.
Jan 1, 2016 11:28
after configuration in which file can I see the version of yii???
Jan 1, 2016 11:28
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.