Beispiel #1
0
 /**
  * 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;
 }
Beispiel #2
0
 /**
  * Run a hook
  *
  * @param       $name
  * @param array $params
  */
 protected function runHook($name, array $params = [])
 {
     Extensions::runHook($name, $params);
 }
Beispiel #3
0
 /**
  * addRouteProjectNameExclusions
  *
  * @param string|array $names
  */
 protected function addRouteProjectNameExclusions($names)
 {
     Extensions::addExcludedProjectNames($names);
 }
Beispiel #4
0
<?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', '(.*)');