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; } }
/** * 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(); }
/** * 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 . "\" ?>"; }); }
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 . "\" ?>"; }