Renders a page
@param string $id id of page (url)
@return string
338324
public function actionView($id = 'index')
    {
        $dir = Yii::getAlias('@pages');
        if(!file_exists($dir)) {
            return $this->render('empty');
        }

        $repo = $this->getFlywheelRepo();
        $page = $repo->query()->where('url', '==', $id)->execute();
        $result = $page->first();

        if($result != null) {

            $this->buildBreadcrumbs($result->url);

            $view_params = array_slice((array)$result, 2);
            foreach($view_params as $key => $value) {
                Yii::$app->view->params[$key] = $value;
            }
            $github_link = 'https://github.com/'
                . $this->module->github_owner
                . '/' . $this->module->github_repo
                . '/blob'
                . '/' . $this->module->github_branch
                . $result->file;
            Yii::$app->view->params['github-link'] = $github_link;

            //TODO: either turn this into an option
            // or remove it altogether
            //$this->setMetatags($result);

            //TODO: this should probably go as there is
            // little need for diferent layouts
            // if(isset($result->layout)) {
            //     //TODO: error checking ?
            //     $this->layout = $result->layout;
            // }

            $cacheKey = 'content-' . $id;
            $content = $this->module->cache->get($cacheKey);
            $headings = $this->module->cache->get($cacheKey . '-headings');
            if ((!$content) || (!$headings)) {
                $parser = new MdPagesMarkdown();

                $page_content = Yii::getAlias('@pages') . $result->file;
                if(!file_exists($page_content)) {
                    throw new NotFoundHttpException("Cound not find the page to render.");
                }
                $content = $parser->parse(file_get_contents($page_content));
                $headings = $parser->getHeadings();

                $this->module->cache->set($cacheKey, $content, $this->module->caching_time);
                $this->module->cache->set($cacheKey . '-headings', $headings, $this->module->caching_time);
            }

            if(isset($result->view)) {
                $view_to_use = $result->view;
                if(isset(Yii::$app->view->theme)) {
                    $render_view = Yii::$app->view->theme->getBasePath() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'page' . DIRECTORY_SEPARATOR . $result->view . '.' . Yii::$app->view->defaultExtension;
                } else {
                    $render_view = 'nothing';
                }
                if(!is_file($render_view)) {
                    $render_view = $this->getViewPath() . DIRECTORY_SEPARATOR . $result->view . '.' . Yii::$app->view->defaultExtension;
                    if(!is_file($render_view)) {
                        throw new NotFoundHttpException("Cound not find the view called '$result->view'.");
                    }
                }
                return $this->render($view_to_use, array('content' => $content, 'headings' => $headings, 'page' => $result));
            } else {
                return $this->render('view', array('content' => $content, 'headings' => $headings, 'page' => $result));
            }

        } else {
            throw new NotFoundHttpException("Cound not find the page to render.");
        }
    }
682230
public function inspect(string $id)
    {
        $url = $this->url.'/'.$id;

        return $this->curl->get($url);
    }
331236
public function editAction( $id = null ) {
		$request = $this->getRequest();

		$pageId      = $request->get( 'pageId' );
		$formFieldId = $request->get( 'formFieldId' );
		$uniqId      = $request->get( 'uniqId' );
		$code        = $request->get( 'code', 'networking_init_cms.admin.page' );


		$layoutBlock = $this->admin->getObject( $id );

		/** @var $form \Symfony\Component\Form\Form */
		$form = $this->admin->getForm();
		$form->setData( $layoutBlock );

		$form->handleRequest( $request );
		$response = null;

		if ( $form->isSubmitted() ) {
			if ( $form->isValid() ) {
				$this->admin->update( $layoutBlock );
				$html   = $this->getLayoutBlockFormWidget( $pageId, $formFieldId, $uniqId, $code );
				$status = 200;

				return new Response( $html, $status );
			} else {
				$this->error = true;

				$response = new Response();
				$response->setStatusCode( 500 );
			}

		}

		$view = $form->createView();

		// set the theme for the current Admin Form
		$this->get( 'twig' )->getRuntime( FormRenderer::class )->setTheme( $view, $this->admin->getFormTheme() );

		return $this->renderWithExtraParams(
			'@NetworkingInitCms/PageAdmin/layout_block_edit.html.twig',
			[
				'action' => 'create',
				'form'   => $view,
				'object' => $layoutBlock,
			],
			$response
		);
	}
69145
private static function getRenderer($id)
    {
        if (!isset(self::$renderers[$id])) {
            throw new \InvalidArgumentException("no such renderer: ".$id);
        }
        return self::$renderers[$id];
    }
1055557
public function preview($id)
    {
        $campagne = $this->campagne->find($id);
        $data     = $this->mailjet->getHtml($campagne->api_campagne_id);

        return response($data);
    }
892257
public function actionView($id)
    {
        $model = $this->findModel($id);
        return $this->render('view', [
            'model' => $model,
            'idField' => $this->idField,
            'usernameField' => $this->usernameField,
            'fullNameField' => $this->fullNameField,
        ]);
    }
1070516
public function show($id)
    {
        $parameters = $this->request->getParameters();
        $model = $this->repository->getItem($id, $parameters);
        return $this->modelResponse($model);
    }
589086
public function actionView($id)
    {
        Url::remember('', 'actions-redirect');
        $model = $this->findModel($id);

        return $this->render('view', [
            'model' => $model,
        ]);
    }
121167
function render($class = '', $id = '', $return = false)
    {
        $link = $this->link . ($this->getparams ? '?'.$this->getparams.'&' : '?');
        ?>
        <div <?=(($id != '')? 'id="'.$id.'"' : '')?> <?=(($class != '')? 'class="'.$class.'"' : '')?>>
	        <a class="start" href="<?=$link?>p=1" title="Start">&nbsp;</a>
	        <a class="back" href="<?=$link?>p=<?=max($this->getPageNum() - 1, 1)?>"
		        title="Back">&nbsp;</a>
	        <?foreach($this->getPagesList() as $page):?>
	            <a class="number<?=($page == $this->getPageNum()? ' selected' : '')?>"
                    href="<?=$link?>p=<?=$page?>" title="Back"><?=$page?></a>
	        <?endforeach?>
	        <a class="next" href="<?=$link?>p=<?=min($this->getPageNum() + 1, $this->getPages())?>"
                title="Back">&nbsp;</a>
	        <a class="end" href="<?=$link?>p=<?=$this->getPages()?>"
                title="End">&nbsp;</a>
        </div>
        <?php
    }
1144462
public function preview($id)
	{
		if ( ! $this->auth->check())
		{
			return App::abort(404, 'Page not found');
		}

		return View::make($this->theme.'.preview', array('id' => $id));
	}
150587
public function getPage($id)
    {
        return isset($this->pages[$id])?$this->pages[$id]:null;
    }
725486
public function actionRaw($id)
    {
        $model = $this->findModel($id);
        if ($model && ($model->isPublic() || $model->isAuthor())) {
            Yii::$app->response->format = Response::FORMAT_RAW;
            return $model->content;
        } else {
            Yii::$app->session->setFlash('success', Yii::t('note', 'Note does not exist.'));
            return $this->redirect(['index']);
        }
    }
1008925
public function actionView($id)
    {
        $model = $this->findModel($id);
        if ($model && ($model->isPublic() || $model->isAuthor())) {
            return $this->render('view', [
                'model' => $model,
            ]);
        } else {
            Yii::$app->session->setFlash('success', Yii::t('note', 'Note does not exist.'));
            return $this->redirect(['index',]);
        }
    }
1168464
public function actionView ($id)
		{
			$page = Page::find()->where([ 'id' => $id ])->orWhere([ 'guid' => $id ])->one();
			if ($page === null)
			{
				Yii::$app->notification->errorToSession(Yii::tr('Given page does not exist.', [], 'page'));
				$this->redirect(Url::toRoute([ '/page/index' ]));
			}
			$this->setTitle(Yii::tr('View page', [], 'page'));
			$this->data('page', $page);
			$this->data('useMenu', $this->module->useMenu);
			$this->_tpl = '@pageViews/view';
		}
551399
public function show($id)
    {
        $content = $this->repository->getById($id);
        if (!empty($content)) {
            $this->authorize('read', $content);
            return $this->respondWithSuccess($content, new ContentTransformer);
        }
        return $this->respondNotFound();
    }
349048
public function get_page_type_idstring($id) {
        foreach ($this->types as $pagetype) {
            if ((int)$pagetype->typeid === (int)$id) {
                return $pagetype->idstring;
            }
        }
        return 'unknown';
    }
1157404
public function Form( $id = '' ) {
		if ( $id == '' ) {
			$url = $this->url->linkTo( 'index.php/save' );
		} else {
			$url = $this->url->linkTo( 'index.php/update/' . $id );
		}

		return $this->view( 'form', array( 'id' => $id, 'url' => $url ) );
	}