-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split documentation into smaller chapters
- Loading branch information
1 parent
b2fc4b7
commit a75ebcf
Showing
12 changed files
with
1,397 additions
and
1,198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
Chapter 1. Installation | ||
======================= | ||
|
||
EasyAdmin installation requires you to edit two files and execute two console | ||
commands, as explained in the following steps. | ||
|
||
Step 1: Download the Bundle | ||
--------------------------- | ||
|
||
Open a command console, enter your project directory and execute the | ||
following command to download the latest stable version of this bundle: | ||
|
||
```bash | ||
$ composer require javiereguiluz/easyadmin-bundle | ||
``` | ||
|
||
This command requires you to have Composer installed globally, as explained | ||
in the [installation chapter](https://getcomposer.org/doc/00-intro.md) | ||
of the Composer documentation. | ||
|
||
Step 2: Enable the Bundle | ||
------------------------- | ||
|
||
Then, enable the bundle by adding the following line in the `app/AppKernel.php` | ||
file of your Symfony application: | ||
|
||
```php | ||
<?php | ||
// app/AppKernel.php | ||
|
||
// ... | ||
class AppKernel extends Kernel | ||
{ | ||
public function registerBundles() | ||
{ | ||
$bundles = array( | ||
// ... | ||
new JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle(), | ||
); | ||
} | ||
|
||
// ... | ||
} | ||
``` | ||
|
||
Step 3: Load the Routes of the Bundle | ||
------------------------------------- | ||
|
||
Open your main routing configuration file (usually `app/config/routing.yml`) | ||
and copy the following four lines at the very beginning of it: | ||
|
||
```yaml | ||
# app/config/routing.yml | ||
easy_admin_bundle: | ||
resource: "@EasyAdminBundle/Controller/" | ||
type: annotation | ||
prefix: /admin | ||
|
||
# ... | ||
``` | ||
|
||
Step 4: Prepare the Web Assets of the Bundle | ||
-------------------------------------------- | ||
|
||
This bundles includes several CSS, JavaScript and font files which are used in | ||
the backend interface, Execute the following command to make those assets | ||
available in your Symfony application: | ||
|
||
```cli | ||
php app/console assets:install --symlink | ||
``` | ||
|
||
That's it! Now everything is ready to create your first admin backend. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
Chapter 10. Configuration Reference | ||
=================================== | ||
|
||
Depending on the complexity and the customization of your backend, you can use | ||
different configuration formats. | ||
|
||
Simple Configuration with No Custom Menu Labels | ||
----------------------------------------------- | ||
|
||
This is the simplest configuration and is best used to create a prototype in a | ||
few seconds. Just list the classes of the entities to manage in the backend: | ||
|
||
```yaml | ||
easy_admin: | ||
entities: | ||
- AppBundle\Entity\Customer | ||
- AppBundle\Entity\Product | ||
``` | ||
Simple Configuration with Custom Menu Labels | ||
-------------------------------------------- | ||
This configuration format allows to set the labels displayed in the main menu | ||
of the backend. Just list the entities but use a text-based key for each | ||
entity: | ||
```yaml | ||
easy_admin: | ||
entities: | ||
Customer: AppBundle\Entity\Customer | ||
Inventory: AppBundle\Entity\Product | ||
``` | ||
Advanced Configuration with no Field Configuration | ||
-------------------------------------------------- | ||
This configuration format allows to control which fields, and in which order, | ||
are shown in the listings and in the forms. Just use the `list`, `edit` and | ||
`new` options and define the fields to display in the `fields` option: | ||
|
||
```yaml | ||
easy_admin: | ||
entities: | ||
Customer: | ||
class: AppBundle\Entity\Customer | ||
list: | ||
fields: ['id', 'name', 'email'] | ||
Inventory: | ||
class: AppBundle\Entity\Product | ||
list: | ||
fields: ['id', 'code', 'description', 'price'] | ||
edit: | ||
fields: ['code', 'description', 'price', 'category'] | ||
new: | ||
fields: ['code', 'description', 'price', 'category'] | ||
``` | ||
|
||
If the `edit` and `new` configuration is the same, use instead the special | ||
`form` option, which will be applied to both of them: | ||
|
||
```yaml | ||
easy_admin: | ||
entities: | ||
Customer: | ||
class: AppBundle\Entity\Customer | ||
list: | ||
fields: ['id', 'name', 'email'] | ||
Inventory: | ||
class: AppBundle\Entity\Product | ||
list: | ||
fields: ['id', 'code', 'description', 'price'] | ||
form: | ||
fields: ['code', 'description', 'price', 'category'] | ||
``` | ||
|
||
Advanced Configuration with Custom Field Configuration | ||
------------------------------------------------------ | ||
|
||
This is the most advanced configuration format and it allows you to control the | ||
type, style, help message and label displayed for each field. Customize any | ||
field just by replacing its name with a hash with its properties: | ||
|
||
```yaml | ||
easy_admin: | ||
entities: | ||
Customer: | ||
class: AppBundle\Entity\Customer | ||
list: | ||
fields: ['id', 'name', { property: 'email', label: 'Contact Info' }] | ||
Inventory: | ||
class: AppBundle\Entity\Product | ||
list: | ||
fields: ['id', 'code', 'description', 'price'] | ||
form: | ||
fields: | ||
- { property: 'code', help: 'Alphanumeric characters only' } | ||
- { property: 'description', type: 'textarea' } | ||
- { property: 'price', type: 'number', class: 'input-lg' } | ||
- { property: 'category', label: 'Commercial Category' } | ||
``` | ||
|
||
Combining Different Configuration Formats | ||
----------------------------------------- | ||
|
||
The previous configuration formats can also be combined. This is useful to use | ||
the default configuration when it's convenient and to customize it when needed: | ||
|
||
```yaml | ||
easy_admin: | ||
entities: | ||
Customer: AppBundle\Entity\Customer | ||
Inventory: | ||
class: AppBundle\Entity\Product | ||
list: | ||
fields: ['id', 'code', 'description', 'price'] | ||
form: | ||
fields: | ||
- { property: 'code', help: 'Alphanumeric characters only' } | ||
- { property: 'description', type: 'textarea' } | ||
- { property: 'price', type: 'number', class: 'input-lg' } | ||
- { property: 'category', label: 'Commercial Category' } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
Chapter 11. About this project | ||
============================== | ||
|
||
The main author of this bundle works for SensioLabs, the company behind the | ||
Symfony framework. However, this bundle is not promoted, endorsed or sponsored | ||
by SensioLabs in any way. **This is not the official Symfony admin generator**. | ||
|
||
Our philosophy | ||
-------------- | ||
|
||
EasyAdmin is an open source project with a very **opinionated development**. We | ||
don't make decisions by committee and we're not afraid to refuse the feature | ||
requests proposed by our users. | ||
|
||
We are a very young project and therefore, our resources and community are | ||
still very limited. In order to survive as a project, we must focus on as few | ||
features as possible and we must keep the original vision of the project. | ||
|
||
These are some of our **development principles**: | ||
|
||
* Developers and backend users are our priorities. We'll always prioritize | ||
UX (user experience) and DX (developer experience) over code purity. | ||
* Backend customization is balanced between configuration options and code. | ||
We'll add new options when they are easy and make sense. Otherwise, we'll | ||
provide code extension points. | ||
* Features will only be added if they are useful for a majority of users and | ||
they don't overcomplicate the application code. | ||
* Documentation is more important than code. Everything must be documented | ||
and documentation must be always up-to-date. | ||
|
||
Our roadmap | ||
----------- | ||
|
||
Our **short-term roadmap** of features that will be added soon is available in | ||
[the list of project issues](https://github.com/javiereguiluz/EasyAdminBundle/issues). | ||
|
||
**Long-term roadmap** | ||
|
||
These are the features that we'll implement in the future when we find a | ||
generic and simple way to do it: | ||
|
||
* Complete Doctrine association support (all kinds of associations: one-to- | ||
one, including self-referencing, one-to-many, many-to-one and many-to-many) | ||
* Allow to configure the main color used in the backend (to match the | ||
company's brand color) | ||
* Nested main menu items (two-level only) | ||
* Support for exporting the list or search results to CSV and/or Excel | ||
* Full theme support (not just changing the main color of the backend) | ||
* FOSUserBundle integration | ||
* Form field grouping | ||
* Custom actions for list/search records (in addition to the default `edit` | ||
and `show` actions). | ||
|
||
**Features that we'll never implement** | ||
|
||
From time to time we review the list of features requested by users. This means | ||
that some of the following features may be included in EasyAdmin sometime in | ||
the future. However, it's safe to consider that they'll never be implemented: | ||
|
||
* Support for Symfony-based applications built without the Symfony full- | ||
stack framework (Silex, Laravel, custom Symfony developments, etc.) | ||
* Support for anything different from Doctrine ORM (Propel, Doctrine ODM, | ||
etc.) | ||
* Support for fine-grained security control over entity actions (instead, | ||
use Symfony's built-in security features, such as voters or ACLs). | ||
* Dashboards for backend homepages (with widgets, charts, etc.) | ||
* Breadcrumbs that show the hierarchical navigation to the given page. | ||
* Batch actions to apply the same action to more than one list record | ||
simultaneously. | ||
* CMS-like features. | ||
* Assetic or frontend-tools-based (gulp, grunt, bower) asset processing. | ||
* Support for AngularJS or any other JavaScript-based client-side technology. | ||
|
||
How to Collaborate in this Project | ||
---------------------------------- | ||
|
||
**1.** Ideas, Feature Requests, Issues, Bug Reports and Comments (positive or | ||
negative) are more than welcome. | ||
|
||
**2.** Unsolicited Pull Requests are currently not accepted. | ||
|
||
EasyAdmin is a very young project. In order to protect the original vision of | ||
the project, we don't accept unsolicited Pull Requests. This decision will of | ||
course be revised in the near term, once we fully realize how the project is | ||
being used and what do users expect from us. | ||
|
||
Alternative Projects | ||
-------------------- | ||
|
||
EasyAdmin deliberately discards the most complex and customized backends, | ||
focusing on the simplest 80% of the backend projects. In case you encounter an | ||
unavoidable limitation to develop your backend with EasyAdmin, consider using | ||
any of the following alternative admin generators: | ||
|
||
* [AdmingeneratorGeneratorBundle](https://github.com/symfony2admingenerator/AdmingeneratorGeneratorBundle), | ||
a project similar to EasyAdmin and based on YAML configuration files. It | ||
provides support for Propel, Doctrine ORM and Doctrine ODM models. | ||
* [SonataAdminBundle](https://github.com/sonata-project/SonataAdminBundle), | ||
the most advanced and most customizable admin generator for Symfony | ||
applications. There's nothing you can't do with Sonata. | ||
* [NgAdminGeneratorBundle](https://github.com/marmelab/NgAdminGeneratorBundle), | ||
an AngularJS-based admin generator compatible with any Symfony project | ||
that provides a RESTFul API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Chapter 2. Your First Backend | ||
============================= | ||
|
||
Creating your first backend will take you around 30 seconds, because you just | ||
have to create a simple configuration file. | ||
|
||
Let's suppose that you already have defined in your Symfony application three | ||
Doctrine ORM entities called `Customer`, `Order` and `Product`. Open your main | ||
application configuration file (usually `app/config/config.yml`) and add the | ||
following configuration: | ||
|
||
```yaml | ||
# app/config/config.yml | ||
easy_admin: | ||
entities: | ||
- AppBundle\Entity\Customer | ||
- AppBundle\Entity\Order | ||
- AppBundle\Entity\Product | ||
``` | ||
**Congratulations! You've just created your first fully-featured backend!** | ||
Browse the `/admin` URL in your Symfony application and you'll get access to | ||
the admin backend: | ||
|
||
![Default listing interface](images/easyadmin-customer-listing.png) | ||
|
||
Creating a backend is that simple because EasyAdmin doesn't generate any code, | ||
not even for the templates. All resources are served on-the-fly to ensure an | ||
exceptional developer experience. | ||
|
||
Without any further configuration, EasyAdmin guesses the best settings to make | ||
your admin backend look "good enough". This may be acceptable for simple | ||
backends and rapid prototypes, but most of the times, you need to customize | ||
some parts of the backend. Keep reading to learn how to do it. |
Oops, something went wrong.