/** * Display the specified resource. * GET /options/{id} * * @param $slug * * @return Response */ public function show($slug) { $themes = []; $currentTheme = current_theme(); $id = ''; $optionTabs = OptionTab::all(); $optionTab = OptionTab::where('slug', '=', $slug)->get()->first(); $slug = $optionTab->slug; $pageTitle = $optionTab->display_name . ' Options'; $options = $optionTab->options->all(); if ($slug == 'themes') { $themes = theme_manager()->all(); $id = $optionTab->options->first()->id; } return view('options.index', compact('slug', 'optionTabs', 'options', 'pageTitle', 'themes', 'currentTheme', 'id')); }
//Optional Required Field(s) $themeManager = new \ThemeManager\ThemeManager((new \ThemeManager\Starter())->start($basePath, $requiredFields)); //Via Theme Manager Starter Helper $themeManager = new \ThemeManager\ThemeManager(theme_manager_starter()->start()); // Exception On Invalid $themeManager = new \ThemeManager\ThemeManager(theme_manager_starter()->start($basePath, $requiredFields, true)); /** * Via Helper */ $themeManager = theme_manager(); //Optionally pass in initial base path $themeManager = theme_manager(__DIR__ . '/path/to/themes/'); //Optional Required Field(s) $themeManager = theme_manager($basePath, $requiredFields); // Exception On Invalid $themeManager = theme_manager($basePath, $requiredFields, true); //ThemeCollection $allThemes = $themeManager->all(); //Returns bool $myThemeExists = $themeManager->themeExists('theme-name') ? 'yes' : 'nope'; //Theme Obj or null $myTheme = $themeManager->getTheme('theme-name'); //Array $myThemeInfo = $myTheme->getInfo(); //Array of strings $themeNames = $themeManager->getAllThemeNames(); //First Theme Obj $firstTheme = $allThemes->first(); //Last Theme Obj $lastTheme = $allThemes->last(); //Add another location of themes to the ThemeManager
protected function setUpAlternative($path = null, array $requiredFields = [], $exceptionOnInvalid = false) { $this->themeManager = theme_manager($path, $requiredFields, $exceptionOnInvalid); }