本文整理汇总了PHP中Addons::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Addons::save方法的具体用法?PHP Addons::save怎么用?PHP Addons::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Addons
的用法示例。
在下文中一共展示了Addons::save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model = new Addons();
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['Addons'])) {
$model->attributes = $_POST['Addons'];
if ($model->save()) {
$this->redirect(array('view', 'id' => $model->id));
}
}
$this->render('create', array('model' => $model));
}
示例2: 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();
}
示例3: saveAddoninfo
function saveAddoninfo($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) == 'addon.xml') {
$xml = $zip->getFromIndex($i);
}
}
$xml = new SimpleXMLElement($xml);
$addon = new Addons();
$addon->addon_name = $xml->name;
$addon->addon_title = $xml->title;
$addon->icon_image = $xml->image;
$addon->version = $xml->version;
$addon->author = $xml->author;
$addon->url = $xml->url;
$addon->installed = 0;
$addon->save();
//require the func.php file to load the events to listen
require_once public_path() . "/addons/{$addon->addon_name}/func.php";
Event::fire('backend.addons.saveaddoninfo.' . $addon->addon_name, array($addon));
}