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


PHP Themes::save方法代码示例

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


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

示例1: populateDb

 public function populateDb()
 {
     $config = (require "/../config/cms.php");
     extract($config);
     //addons
     //laracms
     $addon = new Addons();
     $addon->addon_name = 'laracms';
     $addon->addon_title = 'Core System Addon';
     $addon->icon_image = 'http://laravel.com/assets/img/logo-head.png';
     $addon->version = '1.0.1';
     $addon->author = 'bonweb';
     $addon->url = 'http://www.bonweb.gr';
     $addon->installed = 1;
     $addon->save();
     ClassLoader::addDirectories(array(public_path() . "/addons/laracms/controllers", public_path() . "/addons/laracms/models", public_path() . "/addons/laracms/helpers"));
     //add the screensaver setting
     $setting = new Settings();
     $setting->area = 'backend';
     $setting->section = 'laracms';
     $setting->setting_name = 'screensaver';
     $setting->setting_value = '60000';
     $setting->autoload = 1;
     $setting->save();
     //grid manager
     $addon = new Addons();
     $addon->addon_name = 'grid_manager';
     $addon->addon_title = 'Grid Manager';
     $addon->icon_image = 'http://laravel.com/assets/img/logo-head.png';
     $addon->version = '1.0.1';
     $addon->author = 'bonweb';
     $addon->url = 'http://www.bonweb.gr';
     $addon->installed = 1;
     $addon->save();
     ClassLoader::addDirectories(array(public_path() . "/addons/grid_manager/controllers", public_path() . "/addons/grid_manager/models", public_path() . "/addons/grid_manager/helpers"));
     require_once public_path() . "/addons/grid_manager/func.php";
     Event::fire('backend.addons.saveaddoninfo.grid_manager', array($addon));
     //themes
     $theme = new Themes();
     $theme->theme_name = 'lara';
     $theme->theme_title = 'LaraCMS Default Theme';
     $theme->icon_image = 'http://laravel.com/assets/img/logo-head.png';
     $theme->version = '1.0.1';
     $theme->author = 'bonweb';
     $theme->url = 'http://www.bonweb.gr';
     $theme->installed = 1;
     $theme->active = 1;
     $theme->save();
     //users
     $user = new User();
     $user->firstname = 'John';
     $user->lastname = 'Doe';
     $user->email = $config['admin_email'];
     $user->is_admin = '1';
     $pass = Commoner::generatePass('administrator', $config['admin_email']);
     $user->password = Hash::make($pass);
     $user->save();
     $this->info('Your Password is:' . $pass);
     //add the languages
     $lang = new Languages();
     $lang->code = 'en_US';
     $lang->title = 'English';
     $lang->image = "/uploads/flags/Englang.png";
     $lang->active = 1;
     $lang->save();
     $lang = new Languages();
     $lang->code = 'el_GR';
     $lang->title = 'Greek';
     $lang->image = "/uploads/flags/Greece.png";
     $lang->active = 1;
     $lang->save();
 }
开发者ID:basdog22,项目名称:laracms,代码行数:72,代码来源:InstallLara.php

示例2: saveThemeinfo

 function saveThemeinfo($file, $source, $result)
 {
     //read the info and save the data
     $zip = new ZipArchive();
     if ($zip->open($source . $file) !== TRUE) {
     }
     for ($i = 0; $i < $zip->numFiles; $i++) {
         $entry = explode("/", $zip->getNameIndex($i));
         if (end($entry) == 'theme.xml') {
             $xml = $zip->getFromIndex($i);
         }
     }
     $xml = new SimpleXMLElement($xml);
     $theme = new Themes();
     $theme->theme_name = $xml->name;
     $theme->theme_title = $xml->title;
     $theme->icon_image = $xml->image;
     $theme->version = $xml->version;
     $theme->author = $xml->author;
     $theme->url = $xml->url;
     $theme->installed = 0;
     $theme->active = 0;
     Event::fire('backend.themes.savethemeinfo', array($theme));
     $theme->save();
 }
开发者ID:basdog22,项目名称:laracms,代码行数:25,代码来源:UploadsController.php


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