43 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace app\modules\tgbot\controllers;
 | |
| 
 | |
| use app\modules\tgbot\models\Tgbot;
 | |
| use Cassandra\Decimal;
 | |
| use kernel\app_modules\tag\service\TagService;
 | |
| use kernel\Controller;
 | |
| use kernel\helpers\Debug;
 | |
| use kernel\modules\post\models\Post;
 | |
| 
 | |
| class TgMainController extends Controller
 | |
| {
 | |
| 
 | |
|     protected function init(): void
 | |
|     {
 | |
|         parent::init();
 | |
|         $this->cgView->viewPath = APP_DIR . "/modules/tgbot/views/tgbot/main/";
 | |
|         $this->cgView->layout = "main.php";
 | |
|         $this->cgView->layoutPath = APP_DIR . "/modules/tgbot/views/tgbot/layout/";
 | |
|         $this->cgView->addVarToLayout("resources", "/resources/main");
 | |
|     }
 | |
| 
 | |
|     public function actionMain(): void
 | |
|     {
 | |
|         $this->cgView->render("index.php");
 | |
|     }
 | |
| 
 | |
|     public function actionNews(): void
 | |
|     {
 | |
|         $news = TagService::getEntityByTagSlug("novosti", Post::class);
 | |
| 
 | |
|         $this->cgView->render("news.php", ['news' => $news]);
 | |
|     }
 | |
| 
 | |
|     public function actionPromo(): void
 | |
|     {
 | |
|         $news = TagService::getEntityByTagSlug("akcii", Post::class);
 | |
| 
 | |
|         $this->cgView->render("news.php", ['news' => $news]);
 | |
|     }
 | |
| 
 | |
| } |