This is a skeleton MVC project based on Entity Attribute Value Model for Slim 3, and includes Doctrine, Twig, Flash messages and Monolog.
Base on https://github.com/vhchung/slim3-skeleton-mvc
-
Create your project:
``` $ git clone https://github.com/filipefernandes007/eav-slim3.git` $ cd eav-slim3 $ git composer install ``` -
Execute
eav-slim3\sql\eav_slim3_db.sqlto create sample database (MySQL)
$ cd eav-slim3$ php -S localhost:8000 -t ./public- Browse to http://localhost:8888
You can call doctrine CLI directly with:
$ php vendor/doctrine/orm/bin/doctrine
Set logs and cache folder permission to writable when deploy to production environment
app: Application codeapp/src: All class files within theAppnamespaceapp/templates: Twig template filescache/twig: Twig's Autocreated cache fileslog: Log filespublic: Webserver rootvendor: Composer dependenciessql: sql dump file for sample database
public/index.php: Entry point to applicationapp/templates: Twig template directoryapp/settings.php: Configurationapp/dependencies.php: Services for Pimpleapp/middleware.php: Application middlewareapp/routes.php: All application routes are hereapp/src/controllers: Controller class directoryapp/src/entities: Entity class directoryapp/src/repository: Repository class directoryapp/src/Core: Essential code
The EAV Structure
-
Application 1
-
...
-
Application N
-
Module 1
-
...
-
Module 2
-
...
-
Module N
-
State 1 is related with Entity 1, and Entity 1 is defined by {'id':1, 'name':'X', 'description':'Blah!'} ...
-
State N is related with Entity M
-
Register N + 1 AttributeValue M AttributeValue M + 1 AttributeValue M + 2 -
Register N + 2 -
Register N + 3 ... Register N + N
-
-
Entity M
- Attribute 1
- Type Int
- Attribute 2
- Type String32
- Attribute 3
- Type String32
- ...
- Attribute N
- Type String256
- Attribute 1
Feel free to play with this EAV base, but i must remind you that is not ready for production.