当前位置:网站首页>Share the easy-to-use fastadmin open source system - practical part
Share the easy-to-use fastadmin open source system - practical part
2022-06-28 11:47:00 【Programmer Xiao Peng】
One 、 Preface
Installation chapter : Share useful FastAdmin Open source system - Installation chapter Most companies have their own systems for internal use , Let customer service 、 Operational analysis data 、 View data usage , It is characterized by no complex business , Permission control is required , So we need a simple and convenient system . Today I will share with you the next PHP Open source background management system FastAdmin,FastAdmin It is very suitable for small and medium-sized background management systems , It can be used out of the box without secondary development , Suitable for the background of simple business , For example, you can view reports 、 Check the log 、 View records and other requirements , With my push , At present, our company has two back offices using the system .
Two 、 brief introduction
FastAdmin It's based on ThinkPHP5+Bootstrap Rapid background development framework . The system has built-in permission control 、 One click generation CRUD、 One click to generate controller menu and rules 、 One click generation API Interface document and other functions , There are also rich plug-ins that can be downloaded and used , Ecological convenience, very good . Let's use it step by step .
3、 ... and 、 Onekey CRUD
3.1 Add data sheet
To demonstrate CRUD function , We need a simple data sheet , perform SQL Statement to create a piece of data .
CREATE TABLE `fa_teacher` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` char(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT ' Teacher name ',
`sex` tinyint(3) NOT NULL DEFAULT '1' COMMENT ' Gender 1: male 2: Woman ',
`age` int(11) NOT NULL DEFAULT '0' COMMENT ' Age ',
`switch` tinyint(1) NOT NULL DEFAULT '1' COMMENT ' On state 1: Turn on 0: close ',
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT ' Creation time ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT=' The teacher table ';After the data table is created successfully , Let's insert some data .
INSERT INTO `fastdemo`.`fa_teacher`(`id`, `name`, `sex`, `age`, `switch`, `create_time`) VALUES (1, ' Zhang San ', 1, 20, 1, 1644761811);
INSERT INTO `fastdemo`.`fa_teacher`(`id`, `name`, `sex`, `age`, `switch`, `create_time`) VALUES (2, ' Li Si ', 1, 21, 1, 1644761822);
INSERT INTO `fastdemo`.`fa_teacher`(`id`, `name`, `sex`, `age`, `switch`, `create_time`) VALUES (3, ' test ', 2, 22, 1, 1644761831);
INSERT INTO `fastdemo`.`fa_teacher`(`id`, `name`, `sex`, `age`, `switch`, `create_time`) VALUES (4, ' Wang Wu ', 1, 23, 1, 1644761844);3.2 download CRUD plug-in unit
We log in to the system background and click the plug-in management list , Search for crud, Click on the install , Note that you also need to log in to your official account . After successful installation, it will be displayed in the menu bar on the left “ Online command management ”, If not, clear the cache .

3.3 perform CRUD command
Click the online command management menu on the left , Click Add , Generate in one click CRUD Under the tab, select the data table we want to generate , You can also select an association model to complete the join query . Field identification can be set , After setting, we scroll down , Turn to the bottom , Click execute now . You can view the execution results in the command management list .


Four 、 One click menu generation
In the previous step, we generated by one click CRUD after , At this time, the code has been generated , Let's add a menu , Or click the Add button , Select the one click generate menu , Select the controller corresponding to the data table name generated in the previous step , That is to say Teacher.php controller , Click the execute now button , You can see the teacher management list on the left .

We can see the previously inserted data records in the teacher management list , You can also add 、 Delete 、 edit 、 Search function .

5、 ... and 、 Analyze the source code
View the requested address through the console shown above , Called teacher controller , Check the source code and find that there is no implementation in the controller crud, But inherited Backend.

Teacher.php The controller inherits Backend controller ,Backend The controller is introduced into the controller traits Under the Backend.php.

because traits\Backend Used trait,trait Is the solution PHP A code reuse mechanism prepared for single inheritance , Other classes do not inherit traits Under the Backend.php, As long as this class is referenced , You can use the methods in the class . This class implements the basic CRUD function , This eliminates the need to write duplicate code in each controller .

6、 ... and 、 Conclusion
The introduction of this system ends here from installation to application , You can explore other functions by yourself , Thank you for reading , See you next time .
边栏推荐
- ThreadLocal的简单理解
- Calculate time using calendar
- Making and using of static library
- MySQL installation configuration and solving the problem of forgetting root password when reinstalling MySQL
- The development and principle of the metacosmic system
- Allez, Meta - Cosme, comme prévu, cette chaleur ne durera pas longtemps.
- day36 js笔记 ECMA6语法 2021.10.09
- mysql-.sql文件钓鱼上线
- TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush
- day25 js中的预解析、递归函数、事件 2021.09.16
猜你喜欢

如临现场的视觉感染力,NBA决赛直播还能这样看?

TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush

Day34 JS notes regular expression 2021.09.29

无法重新声明块范围变量

Remote login sshd service

Thesis reading (59):keyword based diverse image retrieval with variable multiple instance graph

一套十万级TPS的IM综合消息系统的架构实践与思考

Day36 JS notes ecma6 syntax 2021.10.09

培训通知|2022年境外中资企业机构及人员疫情防控和安全防范专题培训通知

Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
随机推荐
Join hands with cigent: group alliance introduces advanced network security protection features for SSD master firmware
Graduated
setInterval、setTimeout和requestAnimationFrame
Convert the file URL in the browser to a file stream
[sciter]: use of sciter FS module scanning file API and its details
无法重新声明块范围变量
智联招聘基于 Nebula Graph 的推荐实践分享
Pre parsing, recursive functions and events in day25 JS 2021.09.16
Day24 JS notes 2021.09.15
Remote login sshd service
MySQL installation configuration and solving the problem of forgetting root password when reinstalling MySQL
day25 js中的预解析、递归函数、事件 2021.09.16
Mysql使用max函数查询不到最大值
Excel导入导出便捷工具类
Redis6 一:Nosql引入、Redis可以解决什么问题?
MySQL cannot query the maximum value using the max function
携手Cigent:群联为SSD主控固件引入高级网络安全防护特性
太阳能无线LED显示屏的特点
Array method in JS 2021.09.18
[semidrive source code analysis] [x9 chip startup process] 32 - play module analysis - RTOS side