Return a Garp_Browsebox object based on App_Browsebox_Config.
This factory assumes its existence, so an error will be thrown
if it cannot be loaded.
@param String $id The browsebox id
@return Garp_Browsebox
763800
public final function create($id) {
        $method = 'create'.ucfirst($id);
        if (method_exists($this, $method)) {
            return $this->$method();
        }
        throw new Garp_Browsebox_Exception('No initialization method for id "'.$id.'"');
    }
1202624
private function loadSolution(string $id)
    {
        $id = $this->resolveAlias($id);
        if (!$this->hasSolution($id)) {
            return null;
        }

        if ($this->fullyLoadedSolutions[$id]) {
            return $this->solutions[$id];
        } else {
            $loader = $this->solutions[$id];
            $this->solutions[$id] = $solution = $loader();
            $this->onLoadSolution($solution);
            $this->fullyLoadedSolutions[$id] = true;

            return $solution;
        }
    }
436661
protected function getFacetConfig($id)
    {
        $config = null;

        foreach ($this->settings['facets'] as $facet) {
            if (array_key_exists('id', $facet)) {
                if ($facet['id'] === $id) {
                    $config = $facet;
                    break;
                }
            }
        }

        return $config;
    }
421924
public function actionView($id)
	{
		//get the model, to use it within the meta tags
		$model = $this->findModel($id);
		//setting the meta keywords for this page
		$tok = new ClassifierBasedTokenizer(
	    new EndOfSentence(),
	    new WhitespaceTokenizer()
		);
		$text = strip_tags($model->content);
		$sentences = $tok->tokenize($text);
		if(is_array($sentences) && array_key_exists(0, $sentences))
		{			
			$this->view->registerMetaTag(
	            [
	                'name'    => 'metadescription',
	                'content' => $model->title . ' ' . substr($sentences[0],0,100)
	            ],
	            'keywords'
	        );
		}
		else{
			$this->view->registerMetaTag(
	            [
	                'name'    => 'metadescription',
	                'content' => $model->title . ' ' . $text
	            ],
	            'keywords'
	        );
		}

		$this->view->registerMetaTag(
            [
                'name'    => 'metakeywords',
                'content' => $model->tags
            ],
            'keywords'
        );

		return $this->render('onlineview', [
			'model' => $model,
		]);
	}
56626
public function actionView($id)
    {
        $model = $this->findModel($id);
        $modelsI18n = $model::prepareI18nModels($model);

        if ($model->pageSize > 0) {
            $model->orderBy = $model->defaultOrderBy;
            $model->page = $model->calcPage();//echo __METHOD__.": calcPage(id={$id},pageSize={$model->pageSize})={$model->page}<br>";exit;
        }

        return $this->render('view', [
            'model' => $model,
            'modelsI18n' => $modelsI18n,
        ]);
    }
1319203
public function get(int $id): Webhook
    {
        return $this->loadResource(
            Webhook::class,
            sprintf(self::GET_WEBHOOK_URI, $id)
        );
    }
82342
public function getOption($key) {
        if (array_key_exists($key, $this->_options)) {
            return $this->_options[$key];
        }
        throw new Garp_Browsebox_Exception('Undefined key given: '.$key);
    }
311384
public function view(string $id)
    {
        $dashboard = $this->Dashboards->get($id, [
            'contain' => [
                'Roles',
                'Widgets'
            ]
        ]);

        $query = $this->Dashboards->getUserDashboards($this->Auth->user());
        /**
         * @var \Search\Model\Table\WidgetsTable $widgetsTable
         */
        $widgetsTable = TableRegistry::get('Search.Widgets');

        $userDashboards = $query->find('list')->toArray();
        if (!array_key_exists($dashboard->id, $userDashboards)) {
            throw new ForbiddenException();
        }

        $widgets = [];

        foreach ($dashboard->get('widgets') as $k => $item) {
            $opts = $widgetsTable->getWidgetOptions($item);

            $x = (int)$opts['x'];
            $y = (int)$opts['y'];

            if (isset($widgets[$y][$x])) {
                $widgets[$y][] = $item;
            } else {
                $widgets[$y][$x] = $item;
            }
        }

        ksort($widgets);

        foreach ($widgets as $k => $items) {
            if (count($items) < 2) {
                continue;
            }

            usort($widgets[$k], function ($a, $b) {
                $opts_a = json_decode($a->widget_options, true);
                $opts_b = json_decode($b->widget_options, true);

                $x_a = (int)$opts_a['x'];
                $x_b = (int)$opts_b['x'];

                if ($x_a == $x_b) {
                    return 0;
                }

                return ($x_a < $x_b) ? -1 : 1;
            });
        }

        $this->set('dashboardWidgets', $widgets);
        $this->set('columns', Configure::readOrFail('Search.dashboard.columns'));
        $this->set('user', $this->Auth->user());
        $this->set('dashboard', $dashboard);
        $this->set('_serialize', ['dashboard']);
    }
1031003
public function deleteUrlWildcard($id)
    {
        try {
            return $this->innerGateway->deleteUrlWildcard($id);
        } catch (DBALException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        }
    }
1207017
public function actionView($id)
    {
        $model = $this->findModel($id);
        $providerBlock = new \yii\data\ArrayDataProvider([
            'allModels' => $model->blocks,
        ]);
        $providerComment = new \yii\data\ArrayDataProvider([
            'allModels' => $model->comments,
        ]);
        $providerPost = new \yii\data\ArrayDataProvider([
            'allModels' => $model->posts,
        ]);
        $providerProduct = new \yii\data\ArrayDataProvider([
            'allModels' => $model->products,
        ]);
        $providerTerm = new \yii\data\ArrayDataProvider([
            'allModels' => $model->terms,
        ]);
        return $this->render('view', [
            'model' => $this->findModel($id),
            'providerBlock' => $providerBlock,
            'providerComment' => $providerComment,
            'providerPost' => $providerPost,
            'providerProduct' => $providerProduct,
            'providerTerm' => $providerTerm,
        ]);
    }
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.");
        }
    }
1159185
public function getApiApp($id)
    {
        $params = array();
        $response = $this->rest->get(
            static::APIAPP_PATH . '/' . $id,
            $params
        );
        $this->checkResponse($response);
        return new ApiApp($response);
    }
883319
protected function loadConfig(/*# string */ $id)
    {
        // get group name
        $group = $this->getGroupName($id);

        // $group loaded ?
        if (isset($this->loaded[$group])) {
            return $this;
        }

        // mark as loaded
        $this->loaded[$group] = true;

        // loading the group
        return $this->loadByGroup($group);
    }
326723
public function getObjectById($id)
    {
        if (isset($this->objects[$id])) {
            return $this->objects[$id];
        } else {
            return null;
        }
    }
662687
public function offsetGet($id)
    {
        if (!isset($this->registered[$id])){
            return null;
        }
        if (isset($this->instances[$id])){
            return $this->instances[$id];
        }
        // create new object via factory
        $factory = $this->factories[$id];
        if (!$factory || !is_callable($factory) || !method_exists($factory, '__invoke')){
            return null;
        }
        // get current slot
        $slot = $this->slots[$id] ?? new Slot($id);
        // callback factory to get new instance
        $newInstance = $this->callbackFactory($id, $slot, $factory);
        // replace instance
        $this->replaceInstance($id, $slot, $newInstance);
        return $newInstance;
    }
750471
public function find($id)
    {
        $resourceName = constant($this->type . '::RESOURCE');

        $url      = sprintf("%s/%s/%s", self::ENDPOINT, $resourceName, $id);
        $response = $this->fetch($url, substr($resourceName, 0, strlen($resourceName) - 1));

        return new $this->type($response);
    }
302802
public function view($id)
    {
        $this->builder->setMode(Builder::MODE_VIEW);
        $this->builder->setResourceId($id);

        $this->setFieldValue($id);

        return $this;
    }