<commit_before><?php

namespace yii2mod\cms\actions;

use yii\base\Action;
use Yii;
use yii\web\NotFoundHttpException;
use yii2mod\cms\models\CmsModel;

/**
 * Class PageAction
 * Render cms page
 * @author  <NAME>
 * @package yii2mod\cms\actions
 */
class PageAction extends Action
{

    /**
     * @var string
     */
    public $layout = '';

    /**
     * Page path
     * @var string
     */
    protected $view = '@vendor/yii2mod/yii2-cms/views/page';

    /**
     * @author <NAME>
     * @throws \yii\web\NotFoundHttpException
     * @return string
     */
    public function run()
    {
        $pageId = Yii::$app->request->get('pageId');
        if (!is_null($pageId)) {
            $model = CmsModel::findOne($pageId);
            if ($model) {
                if (!empty($this->layout)) {
                    $this->controller->layout = $this->layout;
                }
                return $this->controller->render($this->view, [
                    'model' => $model,
                ]);
            }
        }
        throw new NotFoundHttpException('The requested page does not exist.');
    }

}<commit_msg>Update PageAction.php<commit_after><?php

namespace yii2mod\cms\actions;

use yii\base\Action;
use Yii;
use yii\web\NotFoundHttpException;
use yii2mod\cms\models\CmsModel;

/**
 * Class PageAction
 * Render cms page
 * @author  <NAME>
 * @package yii2mod\cms\actions
 */
class PageAction extends Action
{

    /**
     * @var string
     */
    public $layout = '';

    /**
     * Page path
     * @var string
     */
    public $view = '@vendor/yii2mod/yii2-cms/views/page';

    /**
     * @author <NAME>
     * @throws \yii\web\NotFoundHttpException
     * @return string
     */
    public function run()
    {
        $pageId = Yii::$app->request->get('pageId');
        if (!is_null($pageId)) {
            $model = CmsModel::findOne($pageId);
            if ($model) {
                if (!empty($this->layout)) {
                    $this->controller->layout = $this->layout;
                }
                return $this->controller->render($this->view, [
                    'model' => $model,
                ]);
            }
        }
        throw new NotFoundHttpException('The requested page does not exist.');
    }

}
{'fraction_non_alphanumeric': 0.1485235786690172, 'fraction_numerical': 0.004407227853680035, 'mean_word_length': 1.8059332509270705, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5486522', 'n_tokens_mistral': 715, 'n_tokens_neox': 699, 'n_words': 137}