Hi Everybody,
I would like to achieve the following:
public function actionCreate() {
$model = new Kooperacio;
if (isset($_POST['Kooperacio'])) {
$model->setAttributes($_POST['Kooperacio']);
$model->date = new CDbExpression('NOW()');
$model->nev = Partner::model()->findByPk($this->partnerId)->nev . ' ' . $model->date;
if ($model->save()) {
if (Yii::app()->getRequest()->getIsAjaxRequest())
Yii::app()->end();
else
$this->redirect(array('view', 'id' => $model->id));
}
}
$this->render('create', array('model' => $model));
}
this is the point:
$model->nev = Partner::model()->findByPk($this->partnerId)->nev . ' ' . $model->date;
Result: Partner NOW()
I know this is not working like this, but I have tried a lot of different things already and it’s still not working.
Can somebody please point me to the right direction?
Thanks
BR
c