Wire::isChanged()
Does the object have changes, or has the given property changed?
Applicable only when object has change tracking enabled.
Example
// Check if page has changed
if($page->isChanged()) {
// Page has changes
}
// Check if the page title field has changed
if($page->isChanged('title')) {
// The title has changed
}Usage
// basic usage
$bool = $wire->isChanged();
// usage with all arguments
$bool = $wire->isChanged(string $what = '');Arguments
| Name | Type(s) | Description |
|---|---|---|
$what (optional) | string | Name of property, or if left blank, checks if any properties have changed. |
Return value
boolTrue if property has changed, false if not.
API reference based on ProcessWire core version 3.0.252