preview report as html content

@param mixed $id
@return View
504005
public function html($id)
    {
        $model = Report::query()->find($id)->first();
        $html  = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $model->html);
        $html  = preg_replace('#<link(.*?)>#is', '', $html);
        return $this->presenter->html($html);
    }
1068312
public function show($id)
    {
      $role = Role::with('permissions')->findOrFail($id);
      return \View::make('admin.roles.show', compact('role'));
    }
36044
public function show($id)
	{
		// get the info for that entry
		$model = $this->crud['model'];
		$this->data['entry'] = $model::find($id);
		$this->data['entry']->addFakes($this->getFakeColumnsAsArray());
		$this->data['crud'] = $this->crud;

		// load the view from /resources/views/vendor/dick/crud/ if it exists, otherwise load the one in the package
		return $this->firstViewThatExists('vendor.dick.crud.show', 'crud::show', $this->data);
	}
110133
public function show($id)
    {
        $component = $this->component($id)->templateLayout();
        $html      = $component->__toString();
        if (!strlen($html)) {
            return $component->render();
        }
        return $html;
    }
554102
public function actionPreview($id)
    {
        $emailSpool = $this->loadModel($id);
        echo CHtml::tag('div', array('style' => 'font-family: Arial; font-weight: bold;'), $emailSpool->subject) . '<hr/>';
        echo $emailSpool->swiftMessage->getBody();
    }
526151
public function preview($id = null)
    {
        $photo = $this->Photos->findPendingById($id)
            ->select(['id', 'album_id', 'filename'])
            ->contain([$this->Photos->Albums->getAlias() => ['fields' => ['id', 'title', 'slug']]])
            ->firstOrFail();

        $this->set(compact('photo'));
        $this->render('view');
    }
438475
public function show($id)
    {
        $record = $this->modelRepository->findOrFail($id);

        $this->checkListParents(false);

        return view($this->getShowView(), [
            'moduleKey'           => $this->moduleKey,
            'routePrefix'         => $this->routePrefix,
            'permissionPrefix'    => $this->permissionPrefix,
            'model'               => $this->modelInformation,
            'record'              => $record,
            'recordReference'     => $this->getReferenceRepository()->getReferenceForModel($record),
            'fieldStrategies'     => $this->renderedShowFieldStrategies($record),
            'hasActiveListParent' => (bool) $this->listParentRelation,
            'topListParentOnly'   => $this->showsTopParentsOnly(),
            'listParents'         => $this->listParents,
        ]);
    }
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.");
        }
    }
1244788
public function actionView($id)
    {
        $model = $this->findModel($id);

        return $this->render('view', ['model' => $model, 'items' => $this->getItems($id)]);
    }
1366292
public function view(?string $id = null)
    {
        $calendarAttendee = $this->CalendarAttendees->get($id, [
            'contain' => ['CalendarEvents']
        ]);

        $this->set(compact('calendarAttendee'));
        $this->set('_serialize', ['calendarAttendee']);
    }
1231430
public function html($id)
    {
        libxml_use_internal_errors(true);

        $htmldoc = new InlineStyle(file_get_contents( url('campagne/'.$id)));
        $htmldoc->applyStylesheet($htmldoc->extractStylesheets());

        $html = $htmldoc->getHTML();
        $html = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $html);

        return $html;
    }
1277573
public function actionView($id)
    {
        $model = $this->findModel($id);
        $providerAuthAssignment = new \yii\data\ArrayDataProvider([
            'allModels' => $model->authAssignments,
        ]);
        $providerAuthItemChild = new \yii\data\ArrayDataProvider([
            'allModels' => $model->authItemChildren,
        ]);
        return $this->render('view', [
            'model' => $this->findModel($id),
            'providerAuthAssignment' => $providerAuthAssignment,
            'providerAuthItemChild' => $providerAuthItemChild,
        ]);
    }
634982
public function view($id = null)
    {
        $cmsPermission = $this->CmsPermission->get($id, [
            'contain' => ['CmsTerm', 'CmsContent']
        ]);
        $this->set('cmsPermission', $cmsPermission);
        $this->set('_serialize', ['cmsPermission']);
    }
968283
public function viewAction($id)
    {
        $post = $this->get('opifer.form.post_manager')->getRepository()->find($id);

        if (!$post) {
            return $this->createNotFoundException();
        }

        return $this->render($this->getParameter('opifer_form.post_view_view'), [
            'post' => $post,
        ]);
    }
549833
public function preview($id)
    {
        $item = app(StackRepository::class)->fetchOne((int) $id)->firstOrFail();

        if (in_array($item->notification->type->name, ['email', 'sms'])) {
            $classname    = $item->notification->type->name === 'email' ? EmailNotification::class : SmsNotification::class;
            $notification = app($classname);
            $notification->setModel($item);
            return view('antares/notifications::admin.logs.preview', ['content' => $notification->render()]);
        }

        $decorator = app(SidebarItemDecorator::class);
        $decorated = $decorator->item($item, config('antares/notifications::templates.notification'));
        return new JsonResponse(['content' => $decorated], 200);
    }
1093642
public function show($id)
    {
        $template = $this->client->get(sprintf('templates/%d.json', $id));

        return new Template($this->response($template));
    }
843114
public function edit($id)
    {
        $post = $this->noticiaRepo->findOrFail($id);
        $categorias = $this->categoriaRepo->listPub();
        $tags = $this->tagRepo->listPub();

        return view('admin.noticias.edit', compact('post','categorias','tags'));
    }