/** * @return mixed */ public function actionHlxml() { Yii::$app->response->format = Response::FORMAT_RAW; $headers = Yii::$app->response->headers; $headers->add('Content-Type', 'text/xml; charset=UTF-8'); return $this->renderPartial('hlxml', ['categories' => Category::find()->all(), 'products' => Product::findAll(['export' => true]), 'date' => ProductTranslation::find()->orderBy(['update_time' => SORT_DESC])->one()->update_time]); }
/** * Add a translation. * * @param ProductTranslation $translation */ public function addTranslation(ProductTranslation $translation) { $this->translations[$translation->getLocale()] = $translation; $translation->setTranslatable($this); }