'auth' => 'auth/login',
'delivery/admin-auth' => 'delivery/admin-auth',
['class' => 'yii\rest\UrlRule', 'controller' => ['task']],
+ 'flowwow/feed/<id:\d+>' => 'flowwow/feed',
+ 'POST data-buh/request/<inn:\d+>' => 'data-buh/request'
],
],
'request' => [
class MarketplaceController extends Controller
{
+ public function actions() {
+ return [
+ 'priority' => \yii_app\actions\marketplace\PriorityAction::class,
+ ];
++ }
+ /**
+ * Экшен для генерации и отображения XML-фида.
+ *
+ * @return string
+ */
+ public function actionFeed()
+ {
+ // Получаем информацию о продуктах
+ $productsInfo = MarketplaceService::getAllProductsInfo();
+
+ // Генерируем XML-фид
+ $xmlFeed = MarketplaceService::createXMLFeed($productsInfo);
+
+ // Устанавливаем заголовок, чтобы отдать XML
+ Yii::$app->response->format = Response::FORMAT_RAW;
+ Yii::$app->response->headers->add('Content-Type', 'application/xml; charset=utf-8');
+
+ return $xmlFeed;
+ }
+
+
+ public function actionTestFeed()
+ {
+
+ $productsInfo = MarketplaceService::getSomeProductsInfo(3);
+
+
+ $xmlFeed = MarketplaceService::createXMLFeed($productsInfo);
+
+
+ Yii::$app->response->format = \yii\web\Response::FORMAT_RAW;
+ Yii::$app->response->headers->add('Content-Type', 'application/xml; charset=utf-8');
+
+ return $xmlFeed;
}
}