mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Adding new callbacks into View.
This commit is contained in:
parent
3fe79564b5
commit
c49e261eba
2 changed files with 13 additions and 2 deletions
|
@ -586,11 +586,19 @@ class ViewTest extends CakeTestCase {
|
|||
$View->Helpers->expects($this->at(0))->method('trigger')
|
||||
->with('beforeRender', $this->anything());
|
||||
$View->Helpers->expects($this->at(1))->method('trigger')
|
||||
->with('beforeRenderFile', $this->anything());
|
||||
$View->Helpers->expects($this->at(2))->method('trigger')
|
||||
->with('afterRenderFile', $this->anything());
|
||||
$View->Helpers->expects($this->at(3))->method('trigger')
|
||||
->with('afterRender', $this->anything());
|
||||
|
||||
$View->Helpers->expects($this->at(2))->method('trigger')
|
||||
$View->Helpers->expects($this->at(4))->method('trigger')
|
||||
->with('beforeLayout', $this->anything());
|
||||
$View->Helpers->expects($this->at(3))->method('trigger')
|
||||
$View->Helpers->expects($this->at(5))->method('trigger')
|
||||
->with('beforeRenderFile', $this->anything());
|
||||
$View->Helpers->expects($this->at(6))->method('trigger')
|
||||
->with('afterRenderFile', $this->anything());
|
||||
$View->Helpers->expects($this->at(7))->method('trigger')
|
||||
->with('afterLayout', $this->anything());
|
||||
|
||||
$View->render('index');
|
||||
|
|
|
@ -754,7 +754,10 @@ class View extends Object {
|
|||
$data = $this->viewVars;
|
||||
}
|
||||
$this->_current = $viewFile;
|
||||
|
||||
$this->Helpers->trigger('beforeRenderFile', array($viewFile));
|
||||
$content = $this->_evaluate($viewFile, $data);
|
||||
$this->Helpers->trigger('afterRenderFile', array($viewFile));
|
||||
|
||||
if (isset($this->_parents[$viewFile])) {
|
||||
$this->_stack[] = $this->fetch('content');
|
||||
|
|
Loading…
Add table
Reference in a new issue