Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c30b7c8
Use `new tagName()` without parentheses instead of static contructor
razvbir Mar 3, 2026
8149d93
Use annotations instead of attributes for deprecation
razvbir Mar 4, 2026
5c26f95
Revert "Use annotations instead of attributes for deprecation"
razvbir Mar 4, 2026
1044c71
Add message to deprications
razvbir Mar 4, 2026
d58950a
Modify build and change log
razvbir Mar 4, 2026
0388219
Apply PHP CS Fixer and Rector changes (CI)
razvbir Mar 4, 2026
487547a
Add tests
razvbir Mar 4, 2026
50a9db7
Merge branch 'master' of github.com:razvbir/html
razvbir Mar 4, 2026
155c840
Update src/Widget/CheckboxList/CheckboxList.php
razvbir Mar 6, 2026
52e7923
Update CHANGELOG.md
razvbir Mar 6, 2026
a1e5aaa
Update src/Tag/Base/NormalTag.php
razvbir Mar 6, 2026
ca0163d
Update src/Tag/Base/VoidTag.php
razvbir Mar 6, 2026
c13f890
Update src/Tag/CustomTag.php
razvbir Mar 6, 2026
8d07325
Update src/Widget/RadioList/RadioList.php
razvbir Mar 6, 2026
9fab09b
Update src/Widget/ButtonGroup.php
razvbir Mar 6, 2026
58191cb
Revert "Modify build and change log"
razvbir Mar 6, 2026
65ac00e
CR Changes
razvbir Mar 6, 2026
09d9c82
Apply PHP CS Fixer and Rector changes (CI)
razvbir Mar 6, 2026
cc41b17
Apply PHP CS Fixer and Rector changes (CI)
samdark Mar 6, 2026
fe76b16
Add parenthesis to missed cases
razvbir Mar 6, 2026
d796ca7
Add parenthesis to missed cases
razvbir Mar 6, 2026
c953ad2
Add parenthesis to missed cases
razvbir Mar 7, 2026
881e97c
Add parenthesis to missed cases
razvbir Mar 7, 2026
69f123a
Whitelist Deprecated symbol and fix class_alias
razvbir Mar 7, 2026
bbe68d3
Add parenthesis to missed cases
razvbir Mar 7, 2026
dad58c9
Add parenthesis to missed cases
razvbir Mar 7, 2026
2be0cf0
Apply PHP CS Fixer and Rector changes (CI)
razvbir Mar 7, 2026
c9377b6
Add @codeCoverageIgnore
razvbir Mar 7, 2026
98dd286
Revert "Add @codeCoverageIgnore"
razvbir Mar 7, 2026
2eefab9
Add tests for Deprecated attribute
razvbir Mar 7, 2026
8b8280f
Apply PHP CS Fixer and Rector changes (CI)
razvbir Mar 7, 2026
c660bc5
Remove Deprecated polyfill
razvbir Mar 10, 2026
12ead26
Merge branch 'master' of github.com:razvbir/html
razvbir Mar 10, 2026
09e670c
Apply PHP CS Fixer and Rector changes (CI)
razvbir Mar 10, 2026
37b523b
Improve CHANGELOG message and remove duplication
razvbir Mar 10, 2026
d765cac
Update composer-require-checker.json
razvbir Mar 10, 2026
40a775d
Apply suggestions from code review
samdark Mar 10, 2026
78ca707
Update CHANGELOG.md
vjik Mar 11, 2026
702ed52
Add tests for static constructors
razvbir Mar 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Yii HTML Change Log

## 3.13.0

- Enh #243: Use `new tagName()` instead of static constructor `tagName::tag()` (@razvbir)

## 3.12.1 under development

- New #260: Add `$attributes` parameter to `Html::li()` method (@gauravkumar2525)
- Enh #261: Enhance `RadioList::addRadioWrapClass()` method for cleaner class addition (@vjik)
- Enh #263: Explicitly import classes and constants in "use" section (@mspirkov)
- Enh #243: Use `new tagName()` without parentheses instead of static constructor `tagName::tag()` (@razvbir)

## 3.12.0 December 13, 2025

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ Tag classes allow working with a tag as an object and then get an HTML code by u
to string. For example, the following code:

```php
echo \Yiisoft\Html\Tag\Div::tag()
echo new \Yiisoft\Html\Tag\Div()
->content(
\Yiisoft\Html\Tag\A::tag()
new \Yiisoft\Html\Tag\A()
->mailto('info@example.com')
->content('contact us')
->render()
Expand All @@ -108,7 +108,7 @@ echo \Yiisoft\Html\Tag\Div::tag()
To generate custom tags, use the `CustomTag` class. For example, the following code:

```php
echo \Yiisoft\Html\Tag\CustomTag::name('b')
echo new \Yiisoft\Html\Tag\CustomTag('b')
->content('text')
->attribute('title', 'Important');
```
Expand Down Expand Up @@ -166,7 +166,7 @@ complex HTML in simple PHP.
Represents a group of buttons.

```php
echo \Yiisoft\Html\Widget\ButtonGroup::create()
echo new \Yiisoft\Html\Widget\ButtonGroup()
->buttons(
\Yiisoft\Html\Html::resetButton('Reset Data'),
\Yiisoft\Html\Html::resetButton('Send'),
Expand All @@ -189,7 +189,7 @@ Result will be:
Represents a list of checkboxes.

```php
echo \Yiisoft\Html\Widget\CheckboxList\CheckboxList::create('count')
echo new \Yiisoft\Html\Widget\CheckboxList\CheckboxList('count')
->items([1 => 'One', 2 => 'Two', 5 => 'Five'])
->uncheckValue(0)
->value(2, 5)
Expand All @@ -212,7 +212,7 @@ Result will be:
Represents a list of radio buttons.

```php
echo \Yiisoft\Html\Widget\RadioList\RadioList::create('count')
echo new \Yiisoft\Html\Widget\RadioList\RadioList('count')
->items([1 => 'One', 2 => 'Two', 5 => 'Five'])
->uncheckValue(0)
->value(2)
Expand Down
3 changes: 2 additions & 1 deletion composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"symbol-whitelist": [
"BackedEnum"
"BackedEnum",
"Deprecated"
],
"php-core-extensions": [
"Core",
Expand Down
24 changes: 24 additions & 0 deletions src/Attribute/Deprecated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

namespace Yiisoft\Html\Attribute;

use Attribute;

use const E_USER_DEPRECATED;

#[Attribute]
final class Deprecated
{
public function __construct(
public readonly ?string $message,
public readonly ?string $since,
) {
trigger_error($message ?? '', E_USER_DEPRECATED);
}
}

if (!class_exists('Deprecated')) {
class_alias(Deprecated::class, 'Deprecated');
}
Loading
Loading