Show calendar's list.

@param string $slug

@return response
508652
protected function index()
    {
        $calendars = $this->repository
            ->pushCriteria(new \Litepie\Calendar\Repositories\Criteria\CalendarPublicCriteria())
            ->scopeQuery(function($query){
                return $query->orderBy('id','DESC');
            })->paginate();

        return $this->theme->of('calendar::public.calendar.index', compact('calendars'))->render();
    }
775021
public function showAction($slug, Request $request)
    {
        $em = $this->getDoctrine()->getManager();

        $productService = $this->get("amulen.shop.product");
        $productOrderService = $this->get("amulen.shop.order");
        $productOrderItemService = $this->get("amulen.shop.order.item");

        $entity = $em->getRepository('AmulenShopBundle:Product')->findOneBy(array("slug" => $slug));

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Product entity.');
        } else {
            $seoPage = $this->container->get('sonata.seo.page');
            $baseTitle = $seoPage->getTitle();
            $title = ucfirst($entity->getName()) . " - Productos - " . $baseTitle;

            $seoPage->setTitle($title);
            $seoPage->addMeta('property', "og:type", "product");
            $seoPage->addMeta('property', "og:title", $title);
            $seoPage->addMeta('property', "og:description", $entity->getDescription());
            $seoPage->addMeta('property', "og:url", $this->generateUrl('product_show', [
                'slug' => $entity->getSlug()
            ], UrlGeneratorInterface::ABSOLUTE_URL));
            $seoPage->addMeta('property', "product:price:amount", $entity->getPrice());
            $seoPage->addMeta('property', "product:price:currency", 'ARS');


            if ($entity->getImage()) {
                $absoluteImageUrl = $this->generateUrl('base_path', [], UrlGeneratorInterface::ABSOLUTE_URL);
                $absoluteImageUrl .= $entity->getImage()->getPath();
                $seoPage->addMeta('property', "og:image", $absoluteImageUrl);
            }

        }

        $prodQty = 1;
        
        /* ProductOrder */
        $session = $request->getSession();
        $productOrderId = $session->get('productOrderId');
        $productOrder = $productOrderService->getProductOrder($productOrderId);
        if (!$productOrderId) {
            $session->set('productOrderId', $productOrder->getId());
        }


        return array(
            'entity' => $entity,
            'productQtyOrder' => $prodQty,
            'current_products' => $productOrder->getProductsAdded(),
        );
    }
1220261
public function view($slug = null)
    {
        //Data can be passed as query string, from a widget
        if ($this->request->getQuery('q')) {
            return $this->redirect([$this->request->getQuery('q')]);
        }

        //Gets album ID and title
        $album = $this->PhotosAlbums->findActiveBySlug($slug)
            ->select(['id', 'title'])
            ->cache(sprintf('album_%s', md5($slug)), $this->PhotosAlbums->getCacheName())
            ->firstOrFail();

        $page = $this->request->getQuery('page', 1);
        $this->paginate['limit'] = $this->paginate['maxLimit'] = getConfigOrFail('default.photos');

        //Sets the cache name
        $cache = sprintf('album_%s_limit_%s_page_%s', md5($slug), $this->paginate['limit'], $page);

        //Tries to get data from the cache
        list($photos, $paging) = array_values(Cache::readMany(
            [$cache, sprintf('%s_paging', $cache)],
            $this->PhotosAlbums->getCacheName()
        ));

        //If the data are not available from the cache
        if (empty($photos) || empty($paging)) {
            $query = $this->PhotosAlbums->Photos->findActiveByAlbumId($album->id)
                ->select(['id', 'album_id', 'filename', 'description'])
                ->order([
                    sprintf('%s.created', $this->PhotosAlbums->Photos->getAlias()) => 'DESC',
                    sprintf('%s.id', $this->PhotosAlbums->Photos->getAlias()) => 'DESC',
                ]);

            $photos = $this->paginate($query);

            //Writes on cache
            Cache::writeMany([
                $cache => $photos,
                sprintf('%s_paging', $cache) => $this->request->getParam('paging'),
            ], $this->PhotosAlbums->getCacheName());
        //Else, sets the paging parameter
        } else {
            $this->request = $this->request->withParam('paging', $paging);
        }

        $this->set(compact('album', 'photos'));
    }
689142
public function actionIndex($slug = 'product')
    {
        if (!is_product_type_slug($slug)) {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
        $product_type = ProductType::find()
            ->where(['slug' => $slug])
            ->one();
        $searchModel = new ProductSearch();
        $queryParams = request()->queryParams;
        $queryParams['ProductSearch']['product_type'] = $product_type->name;
        $dataProvider = $searchModel->search($queryParams);
        $dataProvider->sort->defaultOrder = ['id' => SORT_DESC];
        view()->title = t('app', $product_type->name);

        return $this->render('index', [
            'searchModel'  => $searchModel,
            'dataProvider' => $dataProvider,
            'product_type' => $product_type,
        ]);
    }
390959
public function listAction(Request $request)
    {
        $response = $this->getCacheTimeKeeper()->getResponse('AnimeDbCatalogBundle:Storage');
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        /* @var $rep StorageRepository */
        $rep = $this->getDoctrine()->getRepository('AnimeDbCatalogBundle:Storage');

        return $this->render('AnimeDbCatalogBundle:Storage:list.html.twig', [
            'storages' => $rep->getList(),
        ], $response);
    }
1253147
public function preview($slug = null)
    {
        $page = $this->Pages->findPendingBySlug($slug)
            ->contain([$this->Pages->Categories->getAlias() => ['fields' => ['title', 'slug']]])
            ->firstOrFail();

        $this->set(compact('page'));
        $this->render('view');
    }
757968
public function index()
    {
        $this->request->allowMethod(['post', 'put', 'patch']);
        $calendarsTable = TableRegistry::get('Qobo/Calendar.Calendars');

        $events = [];
        $data = $this->request->getData();
        $data = is_array($data)? $data : [];
        if (!empty($data['calendar_id'])) {
            $calendar = $calendarsTable->get($data['calendar_id']);
            $events = $this->CalendarEvents->getEvents($calendar, $data);
        }

        $this->set(compact('events'));
        $this->set('_serialize', 'events');
    }
559419
protected function has_update( $slug ) {
		$update_list = get_site_transient( $this->upgrade_transient );

		return isset( $update_list->response[ $slug ] );
	}
1086680
protected function getContentBySlug($slug) {
        $this->CmsContent = TableRegistry::get('CmsContent');
        $query = $this->CmsContent->find('all');
        $query->where(['name' => $slug]);
        $data = $query->first();
        return $data;
    }
730138
public function actionIndex($slug)
    {
        $this->trigger(self::EVENT_BEFORE_VIEW_SHOW);

        $data['slug'] = $slug;
        $data['route'] = '/' . $this->getRoute();

        $videoFinder = new VideoFinder();
        $data['video'] = $videoFinder->findBySlug($slug);

        if (empty($data['video'])) {
            throw new NotFoundHttpException('The requested page does not exist.');
        }

        $settings = Yii::$app->settings->getAll();
        $settings['videos'] = Module::getInstance()->settings->getAll();

        if ($data['video']['template'] !== '') {
            $template = $data['video']['template'];
        } else {
            $template = 'view';
        }

        Event::on(self::class, self::EVENT_AFTER_VIEW_SHOW, [\ytubes\videos\events\UpdateCountersEvent::class, 'onClickVideo'], $data);

        $this->trigger(self::EVENT_AFTER_VIEW_SHOW);

        return $this->render($template, [
            'data' => $data,
            'settings' => $settings
        ]);
    }
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'));
    }
1275139
public function getPost( $slug ) {

		// Supported post names (ie. slugs)
		$supported = array_keys( $this->supported );
		if ( ! in_array( $slug, $supported, true ) ) {
			return false;
		}

		$args = [
			'name' => $slug,
			'post_type' => 'custom-style',
			'posts_per_page' => 1,
			'post_status' => 'publish',
			'orderby' => 'modified',
			'no_found_rows' => true,
			'cache_results' => true,
		];

		$q = new \WP_Query();
		$results = $q->query( $args );

		if ( empty( $results ) ) {
			return false;
		}

		return $results[0];
	}
854462
public function listOrganizationMenus($organizationId, $slug = null)
    {
        list($response) = $this->listOrganizationMenusWithHttpInfo($organizationId, $slug);
        return $response;
    }
655929
public function showAction($slug)
    {
        $account = $this
            ->getDoctrine()
            ->getRepository('HarvestCloudCoreBundle:Account')
            ->findOneBy(array(
                'profile' => $this->getCurrentProfile(),
                'slug'    => $slug
            ))
        ;

        $postings = $this
            ->getDoctrine()
            ->getRepository('HarvestCloudCoreBundle:Account')
            ->findPostingsForAccount($account)
        ;

        return $this->render('HarvestCloudCoreBundle:Profile/Account:show.html.twig', array(
            'profile'  => $this->getCurrentProfile(),
            'account'  => $account,
            'postings' => $postings,
        ));
    }
159438
public function show($slug)
    {
        /** @var  \Arcanesoft\Blog\Models\Tag  $tag */
        $tag   = Tag::query()->where('slug', $slug)->firstOrFail();
        $posts = $tag->posts()->paginate();

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

        return $this->view('blog::front.tags.show', compact('tag', 'posts'));
    }
1049338
private function getExistingSlugs($slug)
    {
        $list = collect();
        foreach ($this->uniqueModels() as $class) {

            // get entries matching slug
            $slugs = $this->eloqent($class)
                ->whereRaw("slug LIKE '$slug%'")
                ->withTrashed()// trashed, when entry gets activated
                ->get()
                ->pluck('slug');

            $list = $list->merge($slugs);
        }

        return $list;
    }
981032
public function show($slug)
    {
        $page = Page::where('slug', $slug)->first();

        if (!$page) {
            abort(404);
        }

        return view('show', ['page' => $page]);
    }