本文整理汇总了PHP中Admin\Builder\AdminConfigBuilder::suggest方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminConfigBuilder::suggest方法的具体用法?PHP AdminConfigBuilder::suggest怎么用?PHP AdminConfigBuilder::suggest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin\Builder\AdminConfigBuilder
的用法示例。
在下文中一共展示了AdminConfigBuilder::suggest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uninstall
public function uninstall()
{
$aId = I('id', 0, 'intval');
$aNav = I('remove_nav', 0, 'intval');
$moduleModel = new ModuleModel();
$module = $moduleModel->getModuleById($aId);
if (IS_POST) {
$aWithoutData = I('withoutData', 1, 'intval');
//是否保留数据
$res = $this->moduleModel->uninstall($aId, $aWithoutData);
if ($res == true) {
if (file_exists(APP_PATH . '/' . $module['name'] . '/Info/uninstall.php')) {
require_once APP_PATH . '/' . $module['name'] . '/Info/uninstall.php';
}
if ($aNav) {
M('Channel')->where(array('url' => $module['entry']))->delete();
S('common_nav', null);
}
S('admin_modules', null);
$this->success(L('_THE_SUCCESS_OF_THE_UNLOADING_MODULE_'), U('lists'));
} else {
$this->error(L('_FAILURE_OF_THE_UNLOADING_MODULE_') . $this->moduleModel->error);
}
}
$builder = new AdminConfigBuilder();
$builder->title($module['alias'] . L('_DASH_') . L('_UNLOADING_MODULE_'));
$module['remove_nav'] = 1;
$builder->keyReadOnly('id', L('_MODULE_NUMBER_'));
$builder->suggest('<span class="text-danger">' . L('_OPERATE_CAUTION_') . '</span>');
$builder->keyReadOnly('alias', L('_UNINSTALL_MODULE_'));
$builder->keyBool('withoutData', L('_KEEP_DATA_MODULE_') . '?', L('_DEFAULT_RESERVATION_MODULE_DATA_'))->keyBool('remove_nav', L('_REMOVE_NAVIGATION_'), L('_UNINSTALL_AUTO_UNINSTALL_MENU_', array('link' => U('channel/index'))));
$module['withoutData'] = 1;
$builder->data($module);
$builder->buttonSubmit();
$builder->buttonBack();
$builder->display();
}
示例2: uninstall
public function uninstall()
{
$aId = I('id', 0, 'intval');
$aNav = I('remove_nav', 0, 'intval');
$moduleModel = new ModuleModel();
$module = $moduleModel->getModuleById($aId);
if (IS_POST) {
$aWithoutData = I('withoutData', 1, 'intval');
//是否保留数据
$res = $this->moduleModel->uninstall($aId, $aWithoutData);
if ($res == true) {
if (file_exists(APP_PATH . '/' . $module['name'] . '/Info/uninstall.php')) {
require_once APP_PATH . '/' . $module['name'] . '/Info/uninstall.php';
}
if ($aNav) {
M('Channel')->where(array('url' => $module['entry']))->delete();
S('common_nav', null);
}
S('admin_modules', null);
$this->success('卸载模块成功。', U('lists'));
} else {
$this->error('卸载模块失败。' . $this->moduleModel->error);
}
}
$builder = new AdminConfigBuilder();
$builder->title($module['alias'] . '——卸载模块');
$module['remove_nav'] = 1;
$builder->keyReadOnly('id', '模块编号');
$builder->suggest('<span class="text-danger">请谨慎操作,此操作无法还原。</span>');
$builder->keyReadOnly('alias', '卸载的模块');
$builder->keyBool('withoutData', '是否保留模块数据?', '默认保留模块数据')->keyBool('remove_nav', '移除导航', '卸载后自动卸载掉对应的菜单,或者<a target="_blank" href="' . U('channel/index') . '">手动设置</a>');
$module['withoutData'] = 1;
$builder->data($module);
$builder->buttonSubmit();
$builder->buttonBack();
$builder->display();
}