/** * Render the document. * * This will run all document:render hooks and then return the * output. Should be called within a view. * * @return string */ public function render() { $this->runHook('document:render', [$this]); $fsettings = $this->project->config('filters_settings'); $filters = Extensions::getFilters($this->getProject()->config('filters')); if (count($filters) > 0) { foreach ($filters as $name => $filter) { if ($filter instanceof \Closure) { call_user_func_array($filter, [$this, isset($fsettings[$name]) ? $fsettings[$name] : []]); } else { $instance = app()->make($filter); call_user_func_array([$instance, 'handle'], [$this, isset($fsettings[$name]) ? $fsettings[$name] : []]); } } } return $this->content; }
/** * Run a hook * * @param $name * @param array $params */ protected function runHook($name, array $params = []) { Extensions::runHook($name, $params); }
/** * addRouteProjectNameExclusions * * @param string|array $names */ protected function addRouteProjectNameExclusions($names) { Extensions::addExcludedProjectNames($names); }
<?php /* |-------------------------------------------------------------------------- | Codex Routes |-------------------------------------------------------------------------- | */ Route::get('/', ['as' => 'codex.index', 'uses' => 'CodexController@index']); Route::get('{projectSlug}/{ref?}/{document?}', ['as' => 'codex.document', 'uses' => 'CodexController@document'])->where('projectSlug', '^((?!' . \Codex\Codex\Extensions::getExcludedProjectNames(true) . ').*?)$')->where('document', '(.*)');