mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Adhering to CakePHP coding standards
This commit is contained in:
parent
f9aa954562
commit
6623a8a7f4
1 changed files with 9 additions and 3 deletions
|
@ -245,20 +245,26 @@ class TestObjectWithoutToString {
|
||||||
* An event listener to test cakePHP events
|
* An event listener to test cakePHP events
|
||||||
*/
|
*/
|
||||||
class TestViewEventListener implements CakeEventListener {
|
class TestViewEventListener implements CakeEventListener {
|
||||||
|
|
||||||
public $beforeRenderViewType;
|
public $beforeRenderViewType;
|
||||||
|
|
||||||
public $afterRenderViewType;
|
public $afterRenderViewType;
|
||||||
|
|
||||||
public function implementedEvents() {
|
public function implementedEvents() {
|
||||||
return array(
|
return array(
|
||||||
"View.beforeRender"=>"beforeRender",
|
'View.beforeRender' => 'beforeRender',
|
||||||
"View.afterRender" =>"afterRender",
|
'View.afterRender' => 'afterRender',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function beforeRender($event) {
|
public function beforeRender($event) {
|
||||||
$this->beforeRenderViewType = $event->subject()->getCurrentType();
|
$this->beforeRenderViewType = $event->subject()->getCurrentType();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterRender($event) {
|
public function afterRender($event) {
|
||||||
$this->afterRenderViewType = $event->subject()->getCurrentType();
|
$this->afterRenderViewType = $event->subject()->getCurrentType();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* ViewTest class
|
* ViewTest class
|
||||||
|
@ -835,7 +841,7 @@ class ViewTest extends CakeTestCase {
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testViewEvent(){
|
public function testViewEvent() {
|
||||||
$View = new View($this->PostsController);
|
$View = new View($this->PostsController);
|
||||||
$View->autoLayout = false;
|
$View->autoLayout = false;
|
||||||
$listener = new TestViewEventListener();
|
$listener = new TestViewEventListener();
|
||||||
|
|
Loading…
Add table
Reference in a new issue