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
@@ -22,7 +22,7 @@ For more information about how Corcel works please visit [the repository](http:/
22
22
# Installation
23
23
24
24
To install the ACF plugin for Corcel is easy:
25
-
25
+
26
26
```
27
27
composer require corcel/acf
28
28
```
@@ -41,16 +41,16 @@ echo $post->acf->url; // returns the url custom field created using ACF
41
41
## Performance
42
42
43
43
When using something like `$post->acf->url` the plugin has to make some extra SQL queries to get the field type according ACF approach. So we created another way to get that without making those extra queries. You have only the inform the plugin what is the post type, as a function:
44
-
44
+
45
45
```php
46
46
// Extra queries way
47
47
echo $post->acf->author_username; // it's a User field
48
-
48
+
49
49
// Without extra queries
50
50
echo $post->acf->user('author_username');
51
51
```
52
-
53
-
> PS: The method names should be written in `camelCase()` format. So, for example, for the field type `date_picker` you should write `$post->acf->datePicker('fieldName')`. The plugin does the conversion from `camelCase` to `snake_case` for you.
52
+
53
+
> PS: The method names should be written in `camelCase()` format. So, for example, for the field type `date_picker` you should write `$post->acf->datePicker('fieldName')`. The plugin does the conversion from `camelCase` to `snake_case` for you.
54
54
55
55
## The Idea
56
56
@@ -65,11 +65,11 @@ This plugin works with a basic logic inside `Corcel\Acf\Field\BasicField` abstra
65
65
## What is Missing
66
66
67
67
First we should create the fields classes and the test cases. After we have to setup how Corcel is going to work with the `corcel/acf` plugin, returning the custom field value in the format `$post->meta->field` or maybe `$post->acf->field` having different behavior (done!).
68
-
68
+
69
69
- Create more unit tests for `Repeater` field;
70
-
- Implement the `Flexible Content` field with unit tests;
70
+
- Implement the `Flexible Content` field with unit tests (done!);
71
71
- Improve performance. Currently the plugin makes one SQL query for each field. This goal is to improve that using `whereIn()` clauses.
72
-
72
+
73
73
Some fields are still missing (check table below and contribute).
74
74
75
75
## Fields
@@ -128,4 +128,4 @@ You should import the `database.sql` file to a database inside your local enviro
0 commit comments