/**
  * Yönlendirme işlemi yapar
  *
  * @param string  $adress
  * @param integer $time
  * @throws RedirectUrlEmptyException
  */
 public function __construct($adress = '', $time = 0)
 {
     if ($adress === '') {
         throw new RedirectUrlEmptyException('Yönlendirilecek url boş olamaz');
     }
     parent::__construct();
     $this->setTarget($adress);
     $this->setTime($time);
 }
Exemplo n.º 2
0
 /**
  * Handler the controller returned value
  *
  * @param ViewExecuteInterface|Response|Request|string $response
  * @return string|bool
  */
 private function handleResponse($response)
 {
     if ($response instanceof View) {
         $content = $response->render();
     } elseif ($response instanceof Response) {
         $content = $response->getContent();
     } elseif ($response instanceof Request) {
         $content = $response->getResponse()->getContent();
     } elseif (is_string($response)) {
         $content = $response;
     } else {
         $content = false;
     }
     return $content;
 }
 /**
  * Sınıfı başlatır ve çağrılabilir fonksiyonu kullanır
  *
  * @param callable $callback
  * @param int $statusCode
  */
 public function __construct(callable $callback = '', $statusCode = 200)
 {
     parent::__construct('', $statusCode);
     $this->setCallback($callback);
     $this->setStreamed(false);
 }
 /**
  * @param string $content
  * @param int $statusCode
  */
 public function __construct($content = '', $statusCode = 200)
 {
     parent::__construct($content, $statusCode);
     $this->setContentType('application/json');
 }
Exemplo n.º 5
0
 /**
  * Sayfanın Yürütmesini durdurur.
  */
 private function stopPageProcess()
 {
     Response::make($this->getMessage(), 401)->send();
 }