Added method Page::initialize()

This commit is contained in:
Matias Griese 2021-10-27 14:59:23 +03:00
parent 125f2a8662
commit 1d1c10f0a6
2 changed files with 15 additions and 4 deletions

View File

@ -3,7 +3,7 @@
1. [](#improved)
* Added `route` and `request` to `onPagesInitialized` event
* Improved page cloning
* Improved page cloning, added method `Page::initialize()`
# v1.7.24
## 10/26/2021

View File

@ -220,10 +220,21 @@ class Page implements PageInterface
public function __clone()
{
$this->initialized = false;
$this->header = $this->header ? clone $this->header : null;
$this->route = null;
$this->raw_route = null;
$this->_forms = null;
}
/**
* @return void
*/
public function initialize(): void
{
if (!$this->initialized) {
$this->initialized = true;
$this->route = null;
$this->raw_route = null;
$this->_forms = null;
}
}
/**