You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple back-end life circle for fields inspired on [cockpit](http://getcockpit.com/).
11
-
Via command line you can create fields for your partials and consume in your project using he Repository, Services or Extensions
10
+
Field is a blueprint to work as a CMS inpired on [cockpit](http://getcockpit.com/).
11
+
Via command line you can create fields for your partials and consume in your project using Repository, Services or Extensions.
12
+
13
+
### Example
14
+
15
+
Create some field, running this in your terminal
16
+
```bash
17
+
php vendor/bin/field create Collection about "About page"
18
+
php vendor/bin/field create Field textfield "About text" text about
19
+
php vendor/bin/field create Field imagefield "About image" text about
20
+
```
21
+
22
+
With this code you will create a collection called "About page" and two field for him "About text" and "About image". So you can get this using the Repository:
23
+
```php
24
+
use WilliamEspindola\Field\Storage\ORM\Doctrine;
25
+
use WilliamEspindola\Field\Repository\CollectionFieldRepository;
26
+
27
+
$doctrineStorage = new Doctrine(/** doctrine setup */); // you can uss orther ORM as you want
28
+
$repository = new CollectionFieldRepository($doctrineStorage);
0 commit comments