Skip to content

Commit

Permalink
docs: minor syntax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JorickPepin committed Oct 9, 2024
1 parent cf7a189 commit 8ede167
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,8 @@ Misc. Options

// a custom HTML attribute added when rendering the field
// e.g. setAttribute('data-foo', 'bar') renders a 'data-foo="bar"' attribute in HTML
// it's a shortcut for the equivalent setFormTypeOption('attr.data-foo', 'bar)
->setHtmlAttribute('attribute_name' => 'attribute_value')
// it's a shortcut for the equivalent setFormTypeOption('attr.data-foo', 'bar')
->setHtmlAttribute('attribute_name', 'attribute_value')

// a key-value array of attributes to add to the HTML element
->setHtmlAttributes(['data-foo' => 'bar', 'autofocus' => 'autofocus'])
Expand Down
2 changes: 1 addition & 1 deletion doc/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ First, your test class need to extend the ``AbstractCrudTestCase``::
namespace App\Tests\Admin\Controller;

use App\Controller\Admin\CategoryCrudController;
use App\Controller\Admin\AppDashboardController
use App\Controller\Admin\AppDashboardController;
use EasyCorp\Bundle\EasyAdminBundle\Test\AbstractCrudTestCase;

final class CategoryCrudControllerTest extends AbstractCrudTestCase
Expand Down
2 changes: 1 addition & 1 deletion src/Field/FieldTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function setFormTypeOptionIfNotSet(string $optionName, $optionValue): sel
/**
* Sets the value of a custom HTML attribute that will be added when rendering the field.
* E.g. setAttribute('data-foo', 'bar') will render a 'data-foo="bar"' attribute in HTML.
* It's a shortcut for the equivalent setFormTypeOption('attr.data-foo', 'bar).
* It's a shortcut for the equivalent setFormTypeOption('attr.data-foo', 'bar').
*/
public function setHtmlAttribute(string $attributeName, $attributeValue): self
{
Expand Down

0 comments on commit 8ede167

Please sign in to comment.