当前位置: 首页>>代码示例>>PHP>>正文


PHP Theme::setActiveTheme方法代码示例

本文整理汇总了PHP中Cms\Classes\Theme::setActiveTheme方法的典型用法代码示例。如果您正苦于以下问题:PHP Theme::setActiveTheme方法的具体用法?PHP Theme::setActiveTheme怎么用?PHP Theme::setActiveTheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cms\Classes\Theme的用法示例。


在下文中一共展示了Theme::setActiveTheme方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fire

 /**
  * Execute the console command.
  * @return void
  */
 public function fire()
 {
     $base_path = base_path('');
     $this->info('Dependencies installing begins here! (plugin:install)');
     // DEPENDENCIES
     foreach (['RainLab.Translate', 'Flynsarmy.IdeHelper', 'BnB.ScaffoldTranslation', 'October.Drivers', 'RainLab.GoogleAnalytics', 'Genius.StorageClear'] as $required) {
         $this->info('Installing: ' . $required);
         Artisan::call("plugin:install", ['name' => $required]);
     }
     $this->info('Dependencies installed!');
     // THEME
     $this->info('Installing: oc-genius-theme');
     system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-theme themes/genius");
     Theme::setActiveTheme('genius');
     // ELIXIR
     $this->info('Installing: oc-genius-elixir');
     system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-elixir plugins/genius/elixir");
     // FORMS
     $this->info('Installing: oc-genius-forms');
     system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-forms plugins/genius/forms");
     // BACKUP
     $this->info('Installing: oc-genius-backup');
     system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-backup plugins/genius/backup");
     // GOOGLE ANALYTICS
     $this->info('Initial setup: AnalytcsSettings');
     if (!AnalytcsSettings::get('project_name')) {
         AnalytcsSettings::create(['project_name' => 'API Project', 'client_id' => '979078159189-8afk8nn2las4vk1krbv8t946qfk540up.apps.googleusercontent.com', 'app_email' => '979078159189-8afk8nn2las4vk1krbv8t946qfk540up@developer.gserviceaccount.com', 'profile_id' => '112409305', 'tracking_id' => 'UA-29856398-24', 'domain_name' => 'retrans.srv.br'])->gapi_key()->add(File::create(['data' => plugins_path('genius/base/assets/genius-analytics.p12')]));
     }
     // EMAIL
     $this->info('Initial setup: MailSettings');
     if (!MailSettings::get('mandrill_secret')) {
         MailSettings::create(['send_mode' => 'mandrill', 'sender_name' => 'Genius Soluções Web', 'sender_email' => 'contato@estudiogenius.com.br', 'mandrill_secret' => 't27R2C15NPnZ8tzBrIIFTA']);
     }
     // BRAND
     $this->info('Initial setup: BrandSettings');
     if (!BrandSettings::get('app_init')) {
         BrandSettings::create(['app_name' => 'Genius Soluções Web', 'app_tagline' => 'powered by Genius', "primary_color_light" => "#e67e22", "primary_color_dark" => "#d35400", "secondary_color_light" => "#34495e", "secondary_color_dark" => "#2b3e50", "custom_css" => "", 'app_init' => true])->logo()->add(File::create(['data' => plugins_path('genius/base/assets/genius-logo.png')]));
     }
     // USUARIO BASE
     $this->info('Initial setup: User');
     $user = User::find(1);
     if (!$user->last_name) {
         $user->update(['first_name' => 'Genius', 'last_name' => 'Soluções Web', 'login' => 'genius', 'email' => 'contato@estudiogenius.com.br', 'password' => 'genius', 'password_confirmation' => 'genius']);
         $user->avatar()->add(File::create(['data' => plugins_path('genius/base/assets/genius-avatar.jpg')]));
     }
     $this->info('Genius.Base is ready to rock!');
     $this->info('');
     $this->info('For Laravel Elixir setup run: php artisan elixir:init');
 }
开发者ID:estudiogenius,项目名称:oc-genius-base,代码行数:53,代码来源:GeniusInit.php

示例2: fire

 /**
  * Execute the console command.
  * @return void
  */
 public function fire()
 {
     if (!$this->confirmToProceed('Do you really want to change the active theme?')) {
         return;
     }
     $newThemeName = $this->argument('name');
     $newTheme = Theme::load($newThemeName);
     if (!$newTheme->exists($newThemeName)) {
         return $this->error(sprintf('The theme %s does not exist.', $newThemeName));
     }
     if ($newTheme->isActiveTheme()) {
         return $this->error(sprintf('%s is already the active theme.', $newTheme->getId()));
     }
     $activeTheme = Theme::getActiveTheme();
     $from = $activeTheme ? $activeTheme->getId() : 'nothing';
     $this->info(sprintf('Switching theme from %s to %s', $from, $newTheme->getId()));
     Theme::setActiveTheme($newThemeName);
 }
开发者ID:GoldBest,项目名称:october,代码行数:22,代码来源:ThemeUse.php

示例3: index_onSetActiveTheme

 public function index_onSetActiveTheme()
 {
     CmsTheme::setActiveTheme(Input::get('theme'));
     return ['#theme-list' => $this->makePartial('theme_list')];
 }
开发者ID:nnmer,项目名称:october,代码行数:5,代码来源:Themes.php


注:本文中的Cms\Classes\Theme::setActiveTheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。