shows questions within 1 category

@param string $slug

@return \Symfony\Component\HttpFoundation\Response
173768
public function showAction($slug)
    {
        $category = $this->getCategoryRepository()->retrieveActiveBySlug($slug);

        if (!$category) {
            throw $this->createNotFoundException('category doesnt exists');
        }

        return $this->render(
            'GenjFaqBundle:Category:show.html.twig',
            array(
                'category' => $category
            )
        );
    }
81558
public static function get( $slug ) {
		return isset( self::$queues[ $slug ] ) ? self::$queues[ $slug ] : null;
	}
1245633
public function index(CategoryRequest $request)
    {
        $view = $this->response->theme->listView();

        if ($this->response->typeIs('json')) {
            $function = camel_case('get-' . $view);
            return $this->repository
                ->setPresenter(\Litecms\Faq\Repositories\Presenter\CategoryPresenter::class)
                ->$function();
        }

        $categories = $this->repository->paginate();

        return $this->response->title(trans('faq::category.names'))
            ->view('faq::category.index', true)
            ->data(compact('categories'))
            ->output();
    }
942155
public function link($slug)
    {
        $link = Link::where('slug', $slug)->first();

        if (! $link) {
            abort(404, 'The link was not found');
        }

        return view('links::link', ['link' => $link]);
    }
853308
public function actionViewBySlug($slug)
    {
        $lh = $this->module->langHelper;
        $language = $lh::normalizeLangCode(Yii::$app->language);

        $model = null;
        $modelI18n = $this->module->model('NewsI18n')->findOne([
            'slug' => $slug,
            'lang_code' => $language,
        ]);

        // but after language switching slug for article on another language can be another
        if (empty($modelI18n)) {  // try to get language from referer
            $referer = Yii::$app->request->referrer;
            $hostInfo = Yii::$app->request->hostInfo;
            if (0 === strpos($referer, $hostInfo)) {
                $previousLanguage = substr($referer, strlen($hostInfo) + 1, 2);
                $previousLanguage = $lh::normalizeLangCode($previousLanguage);
                $modelI18n = $this->module->model('NewsI18n')->findOne([
                    'slug' => $slug,
                    'lang_code' => $previousLanguage,
                ]);
                if (!empty($modelI18n)) {  // found i18n-model for previous language
                    $model = $modelI18n->getMain()->one();  // get common model
                    if (!empty($model)) {
                        $modelsI18n = $model::prepareI18nModels($model);
                        if (!empty($modelsI18n[$language])) {
                            // do now show page with illegal slug in URL - prepare to redirect with correct slug
                            $newSlug = $modelsI18n[$language]->slug;
                            $result = Yii::$app->getUrlManager()->parseRequest(Yii::$app->request);
                            if (is_array($result)) {
                                list ($route, $routeParams) = $result;
                                $routeParams[0] = $route;
                                $routeParams['lang'] = $language;
                                $routeParams['slug'] = $newSlug;
                                $link = Yii::$app->urlManager->createUrl($routeParams);
                                return $this->redirect($link);
                            }                
                        }
                    }
                }
            }
        }
        
        if (!empty($modelI18n)) {
            $contentHelper = new $this->contentHelperClass;
            $modelI18n->body = $contentHelper::afterSelectBody($modelI18n->body);
            $model = $modelI18n->getMain()->one();
        }

        $searchModel = $this->module->model('NewsSearchFront');
        $model = $searchModel::canShow($model, $modelI18n);
        if (!$model) {
            $modelI18n = false;
        }

        return $this->render('view', compact('model', 'modelI18n'));
    }
447862
public function actionCategory($id = null, $slug = null)
    {
        if (!is_numeric($id) || $id < 1 || empty($slug)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the category you are looking for.'));
            return $this->redirect(['forum/index']);
        }
        $conditions = ['id' => $id, 'slug' => $slug];
        if ($this->module->user->isGuest) {
            $conditions['visible'] = 1;
        }
        $model = Category::find()->where($conditions)->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the category you are looking for.'));
            return $this->redirect(['forum/index']);
        }
        $this->setMetaTags($model->keywords, $model->description);
        return $this->render('category', ['model' => $model]);
    }
446853
public function slug(string $slug): SectionTwigExtension
    {
        $this->throwNotFound = true;
        $this->options[ReadOptions::SLUG] = $slug;

        return $this;
    }
404565
public
    function index($slug)
    {

        $page = Model::getBySlug($slug);

        if (!$page)
            return response()->view("Jlib::errors.404")->setStatusCode(404);

        return response()->make($page);


    }
562957
protected function show($slug)
    {
        $comment = $this->repository->scopeQuery(function($query) use ($slug) {
            return $query->orderBy('id','DESC')
                         ->where('slug', $slug);
        })->first(['*']);

        return $this->response->title($$comment->name . trans('blog::comment.name'))
            ->view('blog::public.comment.show')
            ->data(compact('comment'))
            ->output();
    }
315884
public function retrieveActiveBySlug($slug)
    {
        $query = $this->createQueryBuilder('c')
            ->where('c.isActive = :isActive')
            ->andWhere('c.slug = :slug')
            ->orderBy('c.rank', 'ASC')
            ->setMaxResults(1)
            ->getQuery();

        $query->setParameter('isActive', true);
        $query->setParameter('slug', $slug);

        return $query->getOneOrNullResult();
    }
67827
public function loadFromSlug(string $slug) : BlogArticle
    {
        $categories = $this->blogArticleRepo->matching(
            $this->blogArticleRepo->criteria()
                ->where(BlogArticle::SLUG, '=', $slug)
                ->where(BlogArticle::PUBLISHED, '=', true)
        );

        if (!$categories) {
            throw new EntityNotFoundException(BlogArticle::class, $slug, BlogArticle::SLUG);
        }

        return reset($categories);
    }
14151
public function getApplicationComponentBySlug($slug)
    {
        $applicationComponents = $this->getApplicationComponents();
        foreach ($applicationComponents as $applicationComponent) {
            if ($applicationComponent->slug == $slug) {
                return $applicationComponent;
            }
        }

        return null;
    }
98564
public function show($slug)
    {
        /** @var  \Arcanesoft\Blog\Models\Category  $category */
        $category = Category::query()->where('slug', $slug)->firstOrFail();
        $posts    = $category->posts()->paginate();

        $this->setTitle($title = "Category: {$category->name}");
        $this->addBreadcrumb($title);

        return $this->view('blog::front.categories.show', compact('category', 'posts'));
    }
713847
public function getExistingSlugs($slug)
    {
        return self::select('slug')->where('slug', 'like', $slug.'%')
            ->when($this->id, function ($query) {
                return $query->where('id', '<>', $this->id);
            })
            ->get();
    }
1022353
public function show(Category $category, Request $request)
    {
        $category->increment('hits');

        $layout   = $request->query('layout', 'blog');
        $limit    = $request->get('limit', $layout == 'list' ? 10 : 6);
        /** @var \Illuminate\Contracts\Pagination\Paginator $articles */
        $articles = $category->articles()->published()->isNotPage()->latest()->paginate($limit);

        if ($layout === 'list') {
            $articles->appends('layout', 'list');
        }

        if ($request->has('limit')) {
            $articles->appends('limit', $limit);
        }

        event(new CategoryWasViewed($category));

        return view("category.$layout", compact('category', 'articles', 'limit'));
    }
878928
public function getPlugin($slug)
    {
        $this->plugins->rewind();
        while ($this->plugins->valid()) {
            if ($this->plugins->current()->getSlug() == $slug) {
                return $this->plugins->current();
            }
            $this->plugins->next();
        }

        return false;
    }
403254
public function slug($slug = null)
    {
        if (null === $slug) {
            return $this->slug;
        }

        $this->slug = $slug;

        return $this;
    }