We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在看到这个扩展前,我也是用这样的表,这么写的。注释了中文,增加了缓存。现在我想把这个继续用起来。 于是我在routes.php中增加: // 网站配置 $router->resource('config', ConfigController::class); 但安装了此扩展后,写这句没用,并没有指向这个控制器。
// 网站配置 $router->resource('config', ConfigController::class);
` /** * Make a form builder. * * @return Form */ protected function form() { $form = new Form(new Config); $form->display('title', '标题'); $form->display('name', '变量名'); $form->text('value', '变量值'); $form->textarea('description', '描述'); $form->display('remark', '备注');
$form->tools(function (Form\tools $tools){ $tools->disableView(); }); $form->footer(function ($footer){ $footer->disableViewCheck(); }); // 表单保存后回调 $form->saved(function (Form $form) { // 配置值写入缓存 $configs = Config::get(); foreach($configs as $val){ $confs[$val['name']] = $val['value']; } // 每次编辑后都重新缓存 Cache::put('web_configs',$confs); }); return $form; }`
谢谢!
The text was updated successfully, but these errors were encountered:
2020的。。。,在源文件里改。vendor_path/laravel-admin-ext/config/src/ConfigController.php
Sorry, something went wrong.
No branches or pull requests
在看到这个扩展前,我也是用这样的表,这么写的。注释了中文,增加了缓存。现在我想把这个继续用起来。
于是我在routes.php中增加:
// 网站配置 $router->resource('config', ConfigController::class);
但安装了此扩展后,写这句没用,并没有指向这个控制器。
` /**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
$form = new Form(new Config);
$form->display('title', '标题');
$form->display('name', '变量名');
$form->text('value', '变量值');
$form->textarea('description', '描述');
$form->display('remark', '备注');
谢谢!
The text was updated successfully, but these errors were encountered: