当前位置:网站首页>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 .
边栏推荐
- Analyze whether there is duplicate data in the list and repeat it several times
- Everyone can participate in open source! Here comes the most important developer activity in dragon lizard community
- 使用logrotate对宝塔的网站日志进行自动切割
- Mysql使用max函数查询不到最大值
- 分析list中有无重复数据且重复了几次
- MySql5.7添加新用户
- 网页提示此站点不安全解决方案
- Solutions to connection failures and errors when accessing mysql8 using the SSM project
- 合约量化系统开发(搭建讲解)丨合约量化系统开发(源码解析及现成案例)
- js中this的默认指向及如何修改指向 2021.11.09
猜你喜欢

New listing of operation light 3.0 - a sincere work of self subversion across the times!
This Exception was thrown from a job compiled with Burst, which has limited exception support. report errors

What method is required for word, PDF and txt files to realize full-text content retrieval?

Necessary for beginners PR 2021 quick start tutorial, PR green screen matting operation method

Simulation of the Saier lottery to seek expectation

day37 js笔记 运动函数 2021.10.11

Jetpack Compose Desktop 桌面版本的打包和发布应用

Array method in JS 2021.09.18

The default point of this in JS and how to modify it to 2021.11.09

Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
随机推荐
Lihongyi, machine learning 7 Conclusion
Simulation of the Saier lottery to seek expectation
When an entity is converted to JSON, the field with null value is lost
Contract quantification system development (construction explanation) - contract quantification system development (source code analysis and ready-made cases)
SQL必需掌握的100个重要知识点:检索数据
Random forest and poetry maker trained by AMR
携手Cigent:群联为SSD主控固件引入高级网络安全防护特性
太阳能无线LED显示屏的特点
Apache2 configuration denies access to the directory, but can access the settings of the files inside
Excel import / export convenience tool class
來吧元宇宙,果然這熱度一時半會兒過不去了
QML控件类型:TabBar
无法重新声明块范围变量
FTP protocol for Wireshark packet capture analysis
It is safer for individuals to choose which securities company to open an account for buying floor funds
Which broker is safer and more convenient to open an account for Oriental Fortune mobile stock?
近况
Necessary for beginners PR 2021 quick start tutorial, PR green screen matting operation method
day24 js笔记 2021.09.15
合约量化交易系统开发 | 合约量化APP开发(现成案例)