Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Field
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Modulus
Services
Field
Commits
b482c733
Commit
b482c733
authored
Apr 01, 2020
by
Sylvain CARRE
🖥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
3332011a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
113 additions
and
0 deletions
+113
-0
README.md
README.md
+113
-0
No files found.
README.md
View file @
b482c733
...
...
@@ -17,6 +17,119 @@ composer require goldenscarab/modulus-service-field
Laravel 5.8 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
## Usage simple
#### Input
```
php
{
!!
Field
::
input
([
'label'
=>
'Champs text'
,
'name'
=>
'my_field_name'
])
!!
}
```
#### Select
```
php
{
!!
Field
::
select
([
'label'
=>
'Menu déroulant'
,
'name'
=>
'my_field_name'
,
'options'
=>
[
1
=>
'Item 1'
,
2
=>
'Item 2'
]
])
!!
}
```
#### Textarea
```
php
{
!!
Field
::
textarea
([
'label'
=>
'Zone de texte'
,
'name'
=>
'my-field'
])
!!
}
```
#### Image
```
php
{
!!
Field
::
image
([
'label'
=>
'Champs image'
,
'name'
=>
'my_field_image'
,
])
!!
}
```
Has identique field with
`pdf`
,
`video`
,
`file`
## Usage advanced
#### Input
```
php
{
!!
Field
::
input
([
'label'
=>
'Moneyt'
,
'name'
=>
'money'
,
'value'
=>
$item
->
money
,
'size'
=>
'sm'
,
'placeholder'
=>
'ex : 1 200,00'
,
'is_required'
=>
true
,
'prefix'
=>
'<i class="fa fa-money"></i>'
,
'suffix'
=>
'€'
,
])
!!
}
```
#### Select
```
php
// Exemple 1
{
!!
Field
::
select
([
'label'
=>
'Menu déroulant'
,
'name'
=>
'my_field_name'
,
'value'
=>
$item
->
my_field_name
,
'placeholder'
=>
'Choisir ...'
,
'size'
=>
'sm'
,
'is_required'
=>
true
,
'options'
=>
[
'collect'
=>
$collection
,
'value'
=>
'id'
,
'text'
=>
[
'code'
,
'libelle'
],
'callback'
=>
'strtoupper'
,
'template'
=>
'Code : %s Libellé : %s'
,
'datas'
=>
[
'attr'
=>
'id'
]
]
])
!!
}
// Exemple 2 with groups
{
!!
Field
::
select
([
'label'
=>
'Menu déroulant'
,
'name'
=>
'my_field_name'
,
'value'
=>
$item
->
my_field_name
,
'placeholder'
=>
'Choisir ...'
,
'size'
=>
'sm'
,
'is_required'
=>
true
,
'options'
=>
[
'Groupe 1'
=>
[
23
=>
'Élement 23'
,
24
=>
'Élement 24'
,
25
=>
'Élement 25'
,
],
'Groupe 2'
=>
[
26
=>
'Élement 26'
,
27
=>
'Élement 27'
,
28
=>
'Élement 28'
,
]
]
])
!!
}
```
#### Image
```
php
{
!!
Field
::
image
([
'label'
=>
'Champs image'
,
'name'
=>
'my_field_image'
,
'value'
=>
$item
->
my_field_image
,
'placeholder'
=>
'ex: /upload/folder/image.png'
,
'suffix'
=>
'<i class="fa fa-file-image-o mr-2"></i> Choisir une image'
,
'is_required'
=>
true
,
])
!!
}
```
Click
[
here
](
example.md
)
for more examples
## Security
If you discover any security related issues, please email contact@goldenscarab.fr instead of using the issue tracker.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment