本文整理汇总了PHP中Extension::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Extension::create方法的具体用法?PHP Extension::create怎么用?PHP Extension::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Extension
的用法示例。
在下文中一共展示了Extension::create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createExtensions
public function createExtensions()
{
$Extension = new Extension();
$this->AdminUsers = $Extension->create(array('name' => 'Admin::Users', 'is_core' => true, 'is_enabled' => true));
$this->AdminPermissions = $Extension->create(array('name' => 'Admin::Permissions', 'is_core' => true, 'is_enabled' => true));
$this->AdminRoles = $Extension->create(array('name' => 'Admin::Roles', 'is_core' => true, 'is_enabled' => true));
$this->AdminDashboard = $Extension->create(array('name' => 'Admin::Dashboard', 'is_core' => true, 'is_enabled' => true));
$this->AdminMenuTabs = $Extension->create(array('name' => 'Admin Menu Tabs', 'is_core' => true, 'is_enabled' => true));
}
示例2: api_save
public function api_save()
{
$data = true;
$_POST['parent'] = $_POST['parent'] == 0 ? null : $_POST['parent'];
if ($_POST['id'] == 'FIRST') {
try {
if (strlen($_POST['value']) > 2) {
$create = Extension::create(array('parent' => $_POST['parent'], 'value' => $_POST['value']));
} else {
$data = false;
}
} catch (Exception $e) {
//ERROR
$data = false;
}
} else {
try {
$save = Extension::find_by_id($_POST['id']);
$save->parent = $_POST['parent'];
$save->value = $_POST['value'];
$save->save();
} catch (Exception $e) {
//ERROR
$data = false;
}
}
echo (string) $data;
}
示例3:
<?php
namespace PHPCrystal\RESTful\Facade;
return Extension::create()->setDirectory(__DIR__)->setComposerName('phpcrystal/restful-api')->setRouter('PHPCrystal\\RESTful\\Service\\Router\\Restful')->init();