Skip to content

Commit

Permalink
Update Fieldtype parameter method name
Browse files Browse the repository at this point in the history
  • Loading branch information
bryannielsen committed Apr 26, 2023
1 parent 2d5c8de commit a4fca1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/advanced/addons/fieldtypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ class SuperCheckbox extends Fieldtype

Typically a fieldtype doesn't need to define parameters up front as they are evaluated dynamically and checked for values at runtime. If you would like to support GraphQL with your fieldtype it is important to list out your parameters so the schema can be generated properly.

Coilpack provides a method `parameters()` for defining which parameters your fieldtype supports. This method will also pass along the field using the fieldtype so you can generate parameters specifically for it. However, this should only be necessary for more complicated fieldtypes like Grid.
Coilpack provides a method `parametersForField()` for defining which parameters your fieldtype supports. This method will also pass along the field using the fieldtype so you can generate parameters specifically for it. However, this should only be necessary for more complicated fieldtypes like Grid.

```php
use Expressionengine\Coilpack\Contracts\Field;

...

public function parameters(Field $field = null): array
public function parametersForField(Field $field = null): array
{
return [
new Expressionengine\Coilpack\Support\Parameter([
Expand Down

0 comments on commit a4fca1a

Please sign in to comment.