A coupon module component - modularity and easy to deploy.
- CouponActivity
- CouponTemplate
- CouponPack = CouponActivity + CouponTemplate
- CouponBatch
- Coupon = CouponPack + CouponBatch
Open the terminal in the project directory:
$ composer require windomz/coupon-module
Create a configuration file, like config.yml
:
database_host: 127.0.0.1
database_port: 3306
database_type: mysql
database_name: coupondb
database_username: root
database_password: root
database_logging: true # open debug log
If only for quick testing,
you can run ./sql/coupondb.sql
in MySQL
to quickly create a test database.
Of course, you can also customize the database name
based on ./sql/coupondb.sql
,
but note that the table name
CANNOT MODIFY!
In the project initialization code, load the specified configuration file through the following implementation:
Coupon::setConfigPath('./config.yml');
Refer to the Document(Currently only Chinese) for details.