add frontend changes

This commit is contained in:
2015-10-30 09:28:58 +01:00
parent 4a04c9efa2
commit e34b150d74
41 changed files with 1083 additions and 254 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace common\components;
use yii\base\Behavior;
use common\models\Customer;
class CustomerAwareBehavior extends Behavior{
public function getCustomerName(){
$result = "";
$customer = $this->owner->customer;
if (isset($customer)){
$result = $customer->name;
}
return $result;
}
public function getCustomer(){
return $this->owner->hasOne( Customer::className(), ["id_customer" =>"id_customer" ] ) ;
}
}