コード例 #1
0
 protected function init($slug)
 {
     $module = WebsiteModule::where('slug', $slug)->get();
     if (!empty($module)) {
         $this->module = $module[0];
         $this->config = $this->module->config;
         $this->initialized = true;
     }
 }
コード例 #2
0
 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     //cmstwo core views
     $this->loadViewsFrom(realpath(__DIR__ . '/resources/views'), 'cmstwoThemer');
     $this->website = WebsiteModule::where('slug', 'core')->get()[0];
     //cmstwo core routes
     $this->setupRoutes($this->app->router);
     //cmstwo theme helpers
     $this->setupHelpers();
 }
コード例 #3
0
 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     //cmstwo core views
     $this->loadViewsFrom(realpath(__DIR__ . '/resources/views'), 'cmstwoAdmin');
     //cmstwo core routes
     $this->setupRoutes($this->app->router);
     Blade::directive('resource', function ($exp) {
         $path = substr($exp, 1, strlen($exp) - 2);
         $website = WebsiteModule::where('slug', 'core')->get()[0]->config;
         $url = $website->url . $this->resourcePath . $path;
         return "<?php echo \"" . $url . "\" ?>";
     });
 }
コード例 #4
0
 public static function asset($exp)
 {
     $path = substr($exp, 1, strlen($exp) - 2);
     $website = WebsiteModule::where('slug', 'core')->get()[0]->config;
     $url = $website->url . 'themes/' . $website->theme . '/' . $path;
     return "<?php echo \"" . $url . "\" ?>";
 }