本文整理汇总了PHP中mw函数的典型用法代码示例。如果您正苦于以下问题:PHP mw函数的具体用法?PHP mw怎么用?PHP mw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mw函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fire
public function fire()
{
$input = array('option_key' => $this->argument('option_key'), 'option_value' => $this->argument('option_value'), 'option_group' => $this->argument('option_group'));
$this->info('Setting option...');
$result = mw()->option_manager->save($input);
$this->info($result);
}
示例2: __construct
function __construct($app = null)
{
if (!is_object($app)) {
$this->app = mw();
} else {
$this->app = $app;
}
}
示例3: get_custom_fields
function get_custom_fields($table, $id = 0, $return_full = false, $field_for = false, $debug = false, $field_type = false, $for_session = false)
{
if (isset($table) and intval($table) > 0) {
$id = intval(intval($table));
$table = 'content';
}
return mw()->fields_manager->get($table, $id, $return_full, $field_for, $debug, $field_type, $for_session);
}
示例4: run
public function run()
{
Cache::flush();
$this->createSchema();
$this->seed();
Cache::flush();
mw()->modules->install();
}
示例5: mw_print_admin_menu_settings_btn
function mw_print_admin_menu_settings_btn()
{
$active = mw()->url_manager->param('view');
$cls = '';
if ($active == 'settings') {
$cls = ' class="active" ';
}
print '<li' . $cls . '><a href="' . admin_url() . 'view:settings" title="' . _e("Settings", true) . '"><i class="ico inavsettings"></i><span>' . _e("Settings", true) . '</span></a></li>';
}
示例6: __construct
public function __construct($app = null)
{
if (is_object($app)) {
$this->app = $app;
} else {
$this->app = mw();
}
$this->set_table_names();
}
示例7: hasNoAdmin
private function hasNoAdmin()
{
if (!$this->checkServiceConfig()) {
$this->registerMwClient();
}
if (mw()->url_manager->param('mw_install_create_user')) {
$this->execCreateAdmin();
}
}
示例8: __construct
function __construct($app = null)
{
$this->set_table_names();
if (is_object($app)) {
$this->app = $app;
} else {
$this->app = mw();
}
$this->socialite = new SocialiteManager($this->app);
}
示例9: __construct
public function __construct($app)
{
if (!is_object($this->app)) {
if (is_object($app)) {
$this->app = $app;
} else {
$this->app = mw();
}
}
$this->app->database_manager->build_table($this->table, $this->fields);
}
示例10: __construct
function __construct($app = null)
{
if (!is_object($this->app)) {
if (is_object($app)) {
$this->app = $app;
} else {
$this->app = mw();
}
}
$this->adapter_current = $this->adapter_default = new MicroweberTemplate($app);
}
示例11: __construct
function __construct($app = null)
{
if (!is_object($this->app)) {
if (is_object($app)) {
$this->app = $app;
} else {
$this->app = mw();
}
}
$this->adapter = new LaravelCache($app);
}
示例12: testSave
public function testSave()
{
mw()->database_manager->extended_save_set_permission(true);
$has_permission = mw()->database_manager->extended_save_has_permission();
$params = array('title' => 'My post with data fields', 'content_type' => 'post', 'data_hi_there' => 'hello world', 'is_active' => 1);
//saving
$id = save_content($params);
$data_fields = content_data($id);
$this->assertEquals(intval($id) > 0, true);
$this->assertEquals($data_fields['hi_there'], "hello world");
$this->assertEquals(true, $has_permission);
}
示例13: testSaveDataFields
public function testSaveDataFields()
{
mw()->database_manager->extended_save_set_permission(true);
$val = 'hello there custom 1-' . rand();
$val2 = 'hello there custom 2-' . rand();
$params = array('title' => 'My post with data attributes 1', 'content_type' => 'post', 'data_fields_something_custom' => $val, 'data_fields_something_else_custom' => $val2, 'is_active' => 1);
$id = save_content($params);
$attributes = content_data($id);
$this->assertEquals(intval($id) > 0, true);
$this->assertEquals($attributes['something_custom'], $val);
$this->assertEquals($attributes['something_else_custom'], $val2);
}
示例14: delete
function delete($data)
{
$adm = is_admin();
if ($adm == false) {
error('Error: not logged in as admin.' . __FILE__ . __LINE__);
}
if (isset($data['id'])) {
$c_id = intval($data['id']);
mw()->database_manager->delete_by_id($this->table, $c_id);
//d($c_id);
}
}
示例15: __construct
function __construct($app = null)
{
if (!is_object($this->app)) {
if (is_object($app)) {
$this->app = $app;
} else {
$this->app = mw();
}
}
if (!is_object($this->adapter)) {
$this->adapter = new Adapters\Http\Guzzle($app);
}
}