src/Website/Control.php
private function action(ActionHandler $handler)
		{
			try {
				$presenter = $this -> presenterFactory
					-> createPresenter($handler -> presenter, $handler -> args);
			}
			catch (\Exception $e) {
				throw new InternalServerErrorException($e -> getMessage());
			}

// Call action/execute
			if (!method_exists($presenter, $handler -> action)) {
				throw new BadFunctionCallException(sprintf("Can not call `%s`.", $handler -> action));
			}
			$presenter -> startup();
			call_user_func_array([$presenter, $handler -> action], []);
//
			$response = $this -> httpResponse;
			if (!$response -> isRedirect() && empty($response -> contents)) {
				$response -> contents = $presenter -> render();
			}
			unset($presenter);
		}
private function action(ActionHandler $handler)
		{
			try {
				$presenter = $this -> presenterFactory
					-> createPresenter($handler -> presenter, $handler -> args);
			}
			catch (\Exception $e) {
				throw new InternalServerErrorException($e -> getMessage());
			}

// Call action/execute
			if (!method_exists($presenter, $handler -> action)) {
				throw new BadFunctionCallException(sprintf("Can not call `%s`.", $handler -> action));
			}
			$presenter -> startup();
			call_user_func_array([$presenter, $handler -> action], []);
//
			$response = $this -> httpResponse;
			if (!$response -> isRedirect() && empty($response -> contents)) {
				$response -> contents = $presenter -> render();
			}
			unset($presenter);
		}
private function action ( ActionHandler $ handler ) { try { $ presenter = $ this -> presenterFactory -> createPresenter ( $ handler -> presenter , $ handler -> args ) ; } catch ( \ Exception $ e ) { throw new InternalServerErrorException ( $ e -> getMessage ( ) ) ; } // Call action/execute if ( ! method_exists ( $ presenter , $ handler -> action ) ) { throw new BadFunctionCallException ( sprintf ( "Can not call `%s`." , $ handler -> action ) ) ; } $ presenter -> startup ( ) ; call_user_func_array ( [ $ presenter , $ handler -> action ] , [ ] ) ; // $ response = $ this -> httpResponse ; if ( ! $ response -> isRedirect ( ) && empty ( $ response -> contents ) ) { $ response -> contents = $ presenter -> render ( ) ; } unset ( $ presenter ) ; }
Process website presenter life-cycle
@param Publixe\Website\ActionHandler
Process website presenter life - cycle