Download the PHP package ip/meat-up without Composer
On this page you can find all versions of the php package ip/meat-up. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package meat-up
MeatUp Bundle
The MeatUp Bundle is a Symfony bundle that provides a command for generating a CRUD controller based on a Doctrine Entity. It uses the Symfony Skeleton Application from inter-Punkt as a starting basis. The bundle will generate the following files for you:
- A FormType based on a Doctrine Entity and some of MeatUps annotations
- A Controller for the CRUD operations
- A view file for a tabular presentation of all records
- View files for creating and updating records
Basic Usage
This guide will show you who to generate a CRUD Controller from a simple Doctrine entity.
Here is a summary of what you will have to do:
- Create a simple Doctrine entity
- Execute the MeatUp command
- Add OnIndex annotation
Step 1: Create a simple Doctrine entity
The example above is a very basic Doctrine entity. If you don't understand everything in there, you can find more information in the Doctrine documentation.
Now you can use a Doctrine command to create the getter and setter methods for you:
Now the entity class is complete and you can create the table in the database:
Step 2: Execute the MeatUp command
Now everything is ready for the MeatUp command to generate your CRUD controller with the the fully qualified class name as argument:
After the command has successfully finished you can start your web server and check out the controller. If you don't know how you can start the built-in Web-Server have a look at the Symfony documentation.
If your Web-server is running as localhost:8000 just enter the following URL in your browser:
You can now go on and create a new record by clicking on the button with the label 'Neuer Eintrag'. After creating the new record you will be redirected to the overview page. There you will see that there is a new record and that you can edit it with a click on the button 'Bearbeiten', but there is no column yet to indicate which record it is.
Step 3: Add OnIndex annotation
Because there is no way for the MeatUp command to guess which properties of your entities you want to show on the overview page, you need to add the OnIndex annotation to tell the bundle that this property should be on it. Luckily we only need to add two lines to the entity above to do that.
First we need to import the MeatUp namespace and add an alias to it:
Now we add the OnIndex annotation to the title property:
That's it! Now we execute the MeatUp command once more and after reloading the website the title will be shown on the overview page with the record we created before:
You now know already how to use the MeatUp command to create simple CRUD controllers. For more advanced usages please refer to the docs.
Usage
For the full usage documentation see:
Resources/doc/index.md
Requirements
- Symfony 2.8.* Skeleton Application
- Symfony Framework Bundle
- Twig
- Doctrine Annotations
- Symfony Filesystem
- IvoryCKEditorBundle
- VichUploaderBundle
License
See the bundled LICENSE file.
All versions of meat-up with dependencies
doctrine/annotations Version ^1.0
doctrine/orm Version ^2.0
symfony/filesystem Version ^2.8|^3.0
twig/twig Version ^1.0|^2.0