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
Copy file name to clipboardExpand all lines: src/widgets/rendering-html-attribute.md
+27-5Lines changed: 27 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Let's look at a simple widget output:
16
16
17
17
## PHP Render Attribute
18
18
19
-
Using the `render()` method, we can add attributes to the HTML tag using `add_render_attribute()` and retrieve the attribute using `get_render_attribute_string()`:
19
+
Using the `render()` method, we can add attributes to the HTML tag using `add_render_attribute()`, retrieve the attributes using `get_render_attribute_string()`, and print attributes using `print_render_attribute_string()`:
Using the `content_template()` method, we can add attributes to the HTML tag using `addRenderAttribute()` and retrieve the attribute using `getRenderAttributeString()`:
55
+
Using the `content_template()` method, we can add attributes to the HTML tag using `addRenderAttribute()`, and retrieve the attribute using `getRenderAttributeString()`:
45
56
46
57
```php
47
58
<?php
@@ -57,8 +68,19 @@ protected function content_template() {
0 commit comments