当前位置:网站首页>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 .
边栏推荐
- 一套十万级TPS的IM综合消息系统的架构实践与思考
- Still using simpledateformat for time formatting? Be careful that the project collapses!
- ProCAST finite element casting process simulation software
- 【sciter】: sciter-fs模块扫描文件API的使用及其注意细节
- Database Series: is there any way to seamlessly upgrade the business tables of the database
- Gee: mcd64a1 based globfire daily fire data set
- Everyone can participate in open source! Here comes the most important developer activity in dragon lizard community
- Pre parsing, recursive functions and events in day25 JS 2021.09.16
- What method is required for word, PDF and txt files to realize full-text content retrieval?
- 选择哪种编程语言,会吸引优秀的人才?
猜你喜欢

Day31 JS notes DOM 2021.09.26

Get current system date

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

Oracle date format exception: invalid number

Everyone can participate in open source! Here comes the most important developer activity in dragon lizard community

For example, the visual appeal of the live broadcast of NBA Finals can be seen like this?

Day33 JS note event (Part 2) September 28, 2021

Making and using of static library

Training notice | special training notice on epidemic prevention and security prevention for overseas Chinese funded enterprises, institutions and personnel in 2022

赛尔号抽奖模拟求期望
随机推荐
Excel导入导出便捷工具类
行业分析| 快对讲,楼宇对讲
2022 开源软件安全状况报告:超41%的企业对开源安全没有足够的信心
Mutual conversion between mytipartfile and file
Day28 strict mode, string JS 2021.09.22
Fancy features and cheap prices! What is the true strength of Changan's new SUV?
Pre parsing, recursive functions and events in day25 JS 2021.09.16
How to distinguish and define DQL, DML, DDL and DCL in SQL
毕业了
day36 js笔记 ECMA6语法 2021.10.09
setInterval、setTimeout和requestAnimationFrame
Makefile introduction
Making and using of static library
Redis6 1: what problems can be solved by the introduction of NoSQL and redis?
Oracle date format exception: invalid number
Necessary for beginners PR 2021 quick start tutorial, PR green screen matting operation method
Day24 JS notes 2021.09.15
如临现场的视觉感染力,NBA决赛直播还能这样看?
day39 原型链及页面烟花效果 2021.10.13
分析list中有无重复数据且重复了几次