Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e660d83

Browse files
committed
Reorganized and updated the entire documentation
1 parent d8a8304 commit e660d83

22 files changed

Lines changed: 2609 additions & 2375 deletions

README.md

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,54 @@ with unprecedented simplicity.
2323
* **CRUD** operations on Doctrine entities (create, edit, list, delete).
2424
* Full-text **search**, **pagination** and column **sorting**.
2525
* Fully **responsive** design (smartphones, tablets and desktops).
26+
* Supports Symfony 2.x and 3.x.
2627
* Translated into tens of languages.
2728
* **Fast**, **simple** and **smart** where appropriate.
2829

2930
**Requirements**
3031

31-
* Symfony 2.3+ applications (including Symfony 3).
32+
* Symfony 2.3+ or 3.x applications (Silex not supported).
3233
* Doctrine ORM entities (Doctrine ODM and Propel not supported).
33-
* Entities with simple primary keys (composite keys not supported).
34-
* Entities using inheritance are not supported.
34+
* Entities with composite keys or using inheritance are not supported.
3535

3636
Documentation
3737
-------------
3838

3939
#### Getting Started Guide
4040

41-
* [Chapter 1 - Installation](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/getting-started/1-installation.md)
42-
* [Chapter 2 - Your First Backend](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/getting-started/2-first-backend.md)
43-
* [Chapter 3 - Backend Configuration](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/getting-started/3-backend-configuration.md)
44-
* [Chapter 4 - Views and Actions](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/getting-started/4-views-and-actions.md)
45-
* [Chapter 5 - Backend Design Customization](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/getting-started/5-design-customization.md)
46-
* [Chapter 6 - About this Project](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/getting-started/6-about-this-project.md)
41+
The [Getting Started Guide](Resources/doc/getting-started.md) explains how to
42+
install the bundle and how to create your first backend. This guide is a must-
43+
read before using EasyAdmin.
44+
45+
#### The Book
46+
47+
* [Chapter 1 - General Configuration](Resources/doc/book/1-general-configuration.md)
48+
* [Chapter 2 - Design Configuration](Resources/doc/book/2-design-configuration.md)
49+
* [Chapter 3 - List, Search and Show Views Configuration](Resources/doc/book/3-list-search-show-configuration.md)
50+
* [Chapter 4 - Edit and New Views Configuration](Resources/doc/book/4-edit-new-configuration.md)
51+
* [Chapter 5 - Actions Configuration](Resources/doc/book/5-actions-configuration.md)
52+
* [Chapter 6 - Menu Configuration](Resources/doc/book/6-menu-configuration.md)
53+
* [Chapter 7 - About this Project](Resources/doc/book/7-about.md)
54+
* [Appendix - Full Configuration Reference](Resources/doc/book/configuration-reference.md)
4755

4856
#### Tutorials
4957

50-
* [Customizing Backend Actions](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/customizing-backend-actions.md)
51-
* [Customizing AdminController](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/customizing-admin-controller.md)
52-
* [Advanced Design Customization](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/advanced-design-customization.md)
53-
* [How to Customize the Main Menu](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/custom-menu.md)
54-
* [How to Format Dates and Numbers](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/format-date-number.md)
55-
* [How to Translate the Backend](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/i18n.md)
56-
* [How to Define Custom Actions](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/custom-actions.md)
57-
* [How to Use a WYSIWYG Editor](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/wysiwyg-editor.md)
58-
* [How to Upload Files and Images](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/upload-files-and-images.md)
59-
* [How to Manage Configuration for Complex Backends](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/complex-backend-config.md)
60-
* [Tips and Tricks](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/tips-and-tricks.md)
61-
* [Configuration Reference](https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Resources/doc/tutorials/configuration-reference.md)
58+
* [How to Translate the Backend](Resources/doc/tutorials/i18n.md)
59+
* [How to Define Custom Actions](Resources/doc/tutorials/custom-actions.md)
60+
* [How to Define Custom Options for Entity Properties](Resources/doc/tutorials/custom-property-options.md)
61+
* [How to Use a WYSIWYG Editor](Resources/doc/tutorials/wysiwyg-editor.md)
62+
* [How to Upload Files and Images](Resources/doc/tutorials/upload-files-and-images.md)
63+
* [How to Manage Configuration for Complex Backends](Resources/doc/tutorials/complex-backend-config.md)
64+
* [Tips and Tricks](Resources/doc/tutorials/tips-and-tricks.md)
6265

6366
> **❮ NOTE ❯** you are reading the documentation of the bundle's **development**
6467
> version. You can also [read the documentation of the latest stable version ➜]
6568
> (https://github.com/javiereguiluz/EasyAdminBundle/tree/v1.11.7/).
6669
67-
#### Demo Application
70+
Demo Application
71+
----------------
6872

69-
[easy-admin-demo](https://github.com/javiereguiluz/easy-admin-demo) is a simple
73+
[easy-admin-demo](https://github.com/javiereguiluz/easy-admin-demo) is a complete
7074
Symfony application created to showcase EasyAdmin features.
7175

7276
Installation
@@ -133,8 +137,7 @@ Creating your first backend will take you less than 30 seconds. Let's suppose
133137
that your Symfony application defines three Doctrine ORM entities called
134138
`Product`, `Category` and `User`.
135139

136-
Creating the backend for those entities just require you to add the following
137-
configuration in the `app/config/config.yml` file:
140+
Open the `app/config/config.yml` file and add the following configuration:
138141

139142
```yaml
140143
# app/config/config.yml
@@ -151,15 +154,7 @@ the admin backend:
151154

152155
![Default EasyAdmin Backend interface](https://raw.githubusercontent.com/javiereguiluz/EasyAdminBundle/master/Resources/doc/images/easyadmin-default-backend.png)
153156

154-
Creating a backend is that simple because EasyAdmin doesn't generate any code.
155-
All resources are served on-the-fly to ensure an exceptional developer
156-
experience.
157-
158-
Without any further configuration, EasyAdmin guesses the best settings to make
159-
your admin backend look "good enough". This may be acceptable for simple
160-
backends and rapid prototypes, but most of the times, you need to customize
161-
some parts of the backend. Keep reading the rest of the documentation to learn
162-
how to do it.
157+
Keep reading the rest of the documentation to learn how to create complex backends.
163158

164159
License
165160
-------
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
Chapter 1. General Configuration
2+
================================
3+
4+
EasyAdmin proposes a hybrid approach to customize the backends:
5+
6+
* Use YAML-based configuration when it's simple to do so;
7+
* Use PHP methods and Twig templates for more advanced customization.
8+
9+
This chapter explains all the general YAML-based configuration options. The rest
10+
of chapters explain how to do extreme backend customizations using PHP methods
11+
and Twig templates.
12+
13+
Changing the URL Used to Access the Backend
14+
-------------------------------------------
15+
16+
By default, the backend is accessible at the `/admin` URL of your Symfony
17+
application. This value is defined in the `prefix` option when loading the
18+
routes of the bundle. Change its value to meet your own requirements:
19+
20+
```yaml
21+
# app/config/routing.yml
22+
easy_admin_bundle:
23+
resource: "@EasyAdminBundle/Controller/"
24+
type: annotation
25+
prefix: /_secret_backend # <-- change this value
26+
27+
# ...
28+
```
29+
30+
Changing the Name of the Backend
31+
--------------------------------
32+
33+
By default, the backend displays `Easy Admin` as its name. Use the `site_name`
34+
option to change this value:
35+
36+
```yaml
37+
# app/config/config.yml
38+
easy_admin:
39+
site_name: 'ACME Megacorp.'
40+
# ...
41+
```
42+
43+
The contents of this option are not escaped before displaying them, so you can
44+
use HTML tags if needed:
45+
46+
```yaml
47+
# app/config/config.yml
48+
easy_admin:
49+
site_name: 'ACME <em style="font-size: 80%;">Megacorp.</em>'
50+
# ...
51+
```
52+
53+
This flexibility allows to use an `<img>` HTML tag to display an image-based
54+
logo instead of a text-based logo:
55+
56+
```yaml
57+
# app/config/config.yml
58+
easy_admin:
59+
site_name: '<img src="http://symfony.com/logos/symfony_white_01.png" />'
60+
# ...
61+
```
62+
63+
Changing the Homepage of the Backend
64+
------------------------------------
65+
66+
By default, the homepage of the backend shows the items of the first configured
67+
entity. Read the [Menu Configuration][1] chapter to learn how to change this
68+
homepage.
69+
70+
Restricting the Access to the Backend
71+
-------------------------------------
72+
73+
EasyAdmin relies on the underlying Symfony security mechanism to restrict the
74+
access to your backend. Read the [Symfony Security documentation][2] to learn
75+
how to protect the backend URLs.
76+
77+
When accessing a protected backend, EasyAdmin displays the name of user who is
78+
logged in the application. Otherwise it displays: "Anonymous User".
79+
80+
-------------------------------------------------------------------------------
81+
82+
[Chapter 2. Design Configuration](2-design-configuration.md) &rarr;
83+
84+
[1]: ./6-menu-configuration.md
85+
[2]: http://symfony.com/doc/current/book/security.html)
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
Chapter 2. Design Configuration
2+
===============================
3+
4+
The design of the backend can be customized in two ways:
5+
6+
1. Defining some global YAML configuration options, which is enough for simple
7+
backends (as explained in this chapter).
8+
2. Overriding the default templates and fragments used to render the backend,
9+
which is useful for very complex backends (as explained in the following
10+
chapters).
11+
12+
General design options are defined under the `design` YAML key.
13+
14+
Changing the Main Backend Color
15+
-------------------------------
16+
17+
Define the `brand_color` option to change the default blue color used by the
18+
backend interface:
19+
20+
```yaml
21+
easy_admin:
22+
design:
23+
brand_color: '#1ABC9C'
24+
# ...
25+
```
26+
27+
![Using a custom brand color in the backend](../images/easyadmin-design-brand-color.png)
28+
29+
The value of the `brand_color` option can use any of the valid CSS color formats:
30+
31+
```yaml
32+
easy_admin:
33+
design:
34+
brand_color: 'red'
35+
brand_color: 'rgba(26, 188, 156, 0.85)'
36+
brand_color: 'hsl(0, 100%, 50%);'
37+
# ...
38+
```
39+
40+
Changing the Color Scheme
41+
-------------------------
42+
43+
By default, backend interface uses a dark color scheme, which is the most common
44+
choice for admin applications. If you prefer a lighter alternative, add the
45+
`color_scheme` option with the `light` value:
46+
47+
```yaml
48+
easy_admin:
49+
design:
50+
# 'dark' is the default value
51+
color_scheme: 'light'
52+
# ...
53+
```
54+
55+
![The default backend homepage using the light color scheme](../images/easyadmin-design-color-scheme-light.png)
56+
57+
Adding Custom Web Assets
58+
------------------------
59+
60+
Complex backends may require to load custom CSS nad JavaScript files. Add the
61+
`assets` option to define the paths of the web assets to load in the backend
62+
layout. All kinds of assets are supported and linked accordingly:
63+
64+
```yaml
65+
easy_admin:
66+
design:
67+
assets:
68+
css:
69+
# HTTP protocol-relative URL
70+
- '//example.org/css/admin1.css'
71+
# absolute non-secure URL
72+
- 'http://example.org/css/admin2.css'
73+
# absolute secure URL
74+
- 'https://example.org/css/admin3.css'
75+
# absolute internal bundle URL
76+
- '/bundles/acmedemo/css/admin4.css'
77+
# relative internal bundle URL
78+
- 'bundles/app/css/admin5.css'
79+
js:
80+
# this option works exactly the same as the 'css' option
81+
- '//example.org/js/admin1.js'
82+
- 'http://example.org/js/admin2.js'
83+
- 'https://example.org/js/admin3.js'
84+
- '/bundles/acmedemo/js/admin4.js'
85+
- 'bundles/app/js/admin5.js'
86+
# ...
87+
```
88+
89+
### CSS Selectors
90+
91+
Every backend page applies some `id` and `class` attributes to its `<body>`
92+
element. The `id` attribute allows you to target specific entity instances and
93+
its value follows this pattern:
94+
95+
| View | `<body>` ID attribute
96+
| ------ | --------------------------------------------------------------------
97+
| `edit` | `easyadmin-edit-<entity_name>-<entity_id>`
98+
| `list` | `easyadmin-list-<entity_name>`
99+
| `new` | `easyadmin-new-<entity_name>`
100+
| `show` | `easyadmin-show-<entity_name>-<entity_id>`
101+
102+
The `class` attribute allows you to target entire sections of the backend and
103+
their values follow these patterns:
104+
105+
| View | `<body>` CSS class
106+
| ------ | --------------------------------------------------------------------
107+
| `edit` | `easyadmin edit edit-<entity_name>`
108+
| `list` | `easyadmin list list-<entity_name>`
109+
| `new` | `easyadmin new new-<entity_name>`
110+
| `show` | `easyadmin show show-<entity_name>`
111+
112+
Changing the favicon
113+
--------------------
114+
115+
A nice trick for backends is to change their favicon to better differentiate
116+
the backend from the public website (this is specially useful when opening lots
117+
of tabs in your browser).
118+
119+
If you want to apply this technique to your backends, create the favicon image
120+
(using any common format: `.ico`, `.png`, `.gif`, `.jpg`) and set the `favicon`
121+
option:
122+
123+
```yaml
124+
easy_admin:
125+
design:
126+
assets:
127+
favicon: '/assets/backend/favicon.png'
128+
# ...
129+
```
130+
131+
The value of the `favicon` option is used as the value of the `href` attribute
132+
of the `<link rel="icon">` element in the backend's layout.
133+
134+
If your favicon uses an uncommon graphic format, you must define both the `path`
135+
of the favicon and its `mime_type`:
136+
137+
```yaml
138+
easy_admin:
139+
design:
140+
assets:
141+
favicon:
142+
path: '/assets/backend/favicon.xxx'
143+
mime_type: 'image/xxx'
144+
# ...
145+
```
146+
147+
-------------------------------------------------------------------------------
148+
149+
&larr; [Chapter 1. General Configuration](1-general-configuration.md) | [Chapter 3. List, Search and Show Views Configuration](2-list-search-show-configuration.md) &rarr;

0 commit comments

Comments
 (0)