Diff
- Type
- Class
- Namespace
- craft\helpers
- Inherits
- craft\helpers\Diff
- Since
- 3.6.0
Diff helper
View source (opens new window)
# Public Methods
Method | Description |
---|---|
compare() | Compares two arrays and returns whether they are identical. |
diff() | Generates a diff for two values, represented as YAML. |
# compare()
- Since
- 3.6.0
Compares two arrays and returns whether they are identical.
If the values are both arrays, they will be compared recursively.
View source (opens new window)
Arguments
$a
(mixed
)$b
(mixed
)$strict
(boolean (opens new window)) – Whether strict comparisons should be used
Returns
# diff()
Generates a diff for two values, represented as YAML.
View source (opens new window)
Arguments
$from
(mixed
)$to
(mixed
)$indent
(integer (opens new window)) – The indent size that nested values should have$contextLines
(integer (opens new window)) – The number of lines to show before and after changes
Returns
← Db ElementHelper →