예제 #1
0
 public function index()
 {
     // get the segments after our route prefix (/foo/bar) and feed into vanilla
     $segments = $this->request->segments();
     if (forum_get_route_prefix() === head($segments)) {
         array_shift($segments);
     }
     // use a default if needed
     if (0 === count($segments)) {
         $segments = ['discussions'];
     }
     // run vanilla with the path and user we want
     $runner = new VanillaRunner();
     $runner->login($this->mapper->current());
     return $runner->view($segments);
 }
예제 #2
0
 private function rewrite_url($path)
 {
     if (starts_with($path, 'http') || starts_with($path, '//')) {
         // absolute
         return $path;
     } else {
         if (starts_with($path, '{')) {
             // smarty template variable
             return $path;
         } else {
             if (empty($path)) {
                 // self
                 return \Request::url();
             } else {
                 // relative
                 return forum_get_route_prefix() . '/' . ltrim($path, '/');
             }
         }
     }
 }
예제 #3
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $setup = new VanillaSetup();
     $setup->install();
     $this->info('Vanilla now connected to Laravel. Try it out at ' . \URL::to(forum_get_route_prefix()));
 }
예제 #4
0
<?php

/**
 * Define the package routes.
 *
 * All these routes exist under $prefix, which is configurable in
 * src/config/routes.php
 */
$prefix = forum_get_route_prefix();
Route::group(['prefix' => $prefix], function () use($prefix) {
    // default all routes through the vanilla passthru
    Route::any('{slug?}', ['uses' => '\\BishopB\\Forum\\PassthruController@index'])->where('slug', '^.*');
});
예제 #5
0
 /**
  * We specifically always want our web root inside our route.
  */
 public function WebRoot($WebRoot = NULL)
 {
     return forum_get_route_prefix();
 }