Overview

Namespaces

  • GLFramework
    • Cache
    • Controller
    • DaMa
      • Manipulators
    • Database
    • HTTP
    • Mail
    • Middleware
    • Model
    • Module
    • Tests
    • Upload
    • Utils
  • None

Classes

  • GLFramework\Bootstrap
  • GLFramework\Cache\Cache
  • GLFramework\Cache\MemcachedCache
  • GLFramework\Cache\MemoryCache
  • GLFramework\Controller
  • GLFramework\Controller\AdminController
  • GLFramework\Controller\APIController
  • GLFramework\Controller\AuthController
  • GLFramework\Controller\ErrorController
  • GLFramework\Controller\ExceptionController
  • GLFramework\DaMa\Association
  • GLFramework\DaMa\DataManipulation
  • GLFramework\DaMa\Manipulator
  • GLFramework\DaMa\Manipulators\CSVManipulator
  • GLFramework\DaMa\Manipulators\ManipulatorCore
  • GLFramework\DaMa\Manipulators\XLSManipulator
  • GLFramework\DaMa\Manipulators\XLSXManipulator
  • GLFramework\Database\Connection
  • GLFramework\Database\MySQLConnection
  • GLFramework\DatabaseManager
  • GLFramework\DBStructure
  • GLFramework\Events
  • GLFramework\Filesystem
  • GLFramework\HTTP\API
  • GLFramework\Log
  • GLFramework\Mail
  • GLFramework\Mail\Mail
  • GLFramework\Mail\MailSystem
  • GLFramework\Mail\PHPMailer
  • GLFramework\MailView
  • GLFramework\Middleware\APIAuthorizationMiddleware
  • GLFramework\Middleware\ControllerMiddleware
  • GLFramework\Model
  • GLFramework\Model\Page
  • GLFramework\Model\User
  • GLFramework\Model\UserPage
  • GLFramework\ModelResult
  • GLFramework\Module\Module
  • GLFramework\Module\ModuleManager
  • GLFramework\Request
  • GLFramework\Response
  • GLFramework\Tests\DatabaseTestCase
  • GLFramework\Tests\TestCase
  • GLFramework\Upload\Upload
  • GLFramework\Upload\Uploads
  • GLFramework\Utils\DataTablesManager
  • GLFramework\Versions
  • GLFramework\View

Interfaces

  • GLFramework\Middleware

Functions

  • array_merge_recursive_ex
  • e
  • file_get_php_classes
  • fix_date
  • fix_date_format
  • fix_decimal
  • fix_url
  • get
  • get_php_classes
  • http_response_code
  • instance_method
  • is_module_enabled
  • now
  • post
  • print_array
  • print_brief_debug
  • print_debug
  • random_str
  • reArrayFiles
  • reArrayPost
  • today
  • Overview
  • Namespace
  • Class
  1: <?php
  2: /**
  3:  * Created by PhpStorm.
  4:  * User: manus
  5:  * Date: 16/03/16
  6:  * Time: 13:05
  7:  */
  8: 
  9: namespace GLFramework;
 10: 
 11: 
 12: class Response
 13: {
 14:     private $content;
 15:     private $uri;
 16:     private $contentType = null;
 17:     private $redirection = null;
 18:     private $ajax;
 19:     private $responseCode = 200;
 20:     /**
 21:      * Obtener el contenid de la respuesta
 22:      * @return mixed
 23:      */
 24:     public function getContent()
 25:     {
 26:         return $this->content;
 27:     }
 28: 
 29:     /**
 30:      * Establecer el contenido de la respuesta
 31:      * @param mixed $content
 32:      */
 33:     public function setContent($content)
 34:     {
 35:         $this->content = $content;
 36:     }
 37: 
 38:     /**
 39:      * Obtener el tipo de contenido de la respuesta
 40:      * @return string
 41:      */
 42:     public function getContentType()
 43:     {
 44:         return $this->contentType;
 45:     }
 46: 
 47:     /**
 48:      * Establece el tipo de contenido de la respuesta
 49:      * @param string $contentType
 50:      */
 51:     public function setContentType($contentType)
 52:     {
 53:         $this->contentType = $contentType;
 54:     }
 55: 
 56:     /**
 57:      * Obtiene la url de la redireccion
 58:      * @return mixed
 59:      */
 60:     public function getRedirection()
 61:     {
 62:         return $this->redirection;
 63:     }
 64: 
 65:     /**
 66:      * Establece la URI de la redireccion
 67:      * @param mixed $redirection
 68:      */
 69:     public function setRedirection($redirection)
 70:     {
 71:         $this->redirection = $redirection;
 72:     }
 73: 
 74:     /**
 75:      * Envia la respuesta al cliente
 76:      */
 77:     public function display()
 78:     {
 79:         Events::fire('beforeResponseSend', array($this));
 80:         \http_response_code($this->getResponseCode());
 81:         if($this->contentType) header("Content-Type: " . $this->contentType);
 82:         if($this->redirection) header("Location: " . $this->redirection);
 83:         print $this->content;
 84:     }
 85: 
 86:     /**
 87:      * true si la respueta tiene una redireccion
 88:      * @return bool
 89:      */
 90:     public function isRedirect()
 91:     {
 92:         return $this->redirection !== null;
 93:     }
 94: 
 95:     /**
 96:      * Establecer la URI de respuesta
 97:      * @param $url
 98:      */
 99:     public function setUri($url)
100:     {
101:         $this->uri = $url;
102:     }
103: 
104:     /**
105:      * Obtener la URI de la respuesta
106:      * @return mixed
107:      */
108:     public function getUri()
109:     {
110:         return $this->uri;
111:     }
112: 
113:     /**
114:      * Devuelve el estado de AJAX
115:      * @return mixed
116:      */
117:     public function getAjax()
118:     {
119:         return $this->ajax;
120:     }
121: 
122:     /**
123:      * Establece el estado de AJAX
124:      * @param mixed $ajax
125:      */
126:     public function setAjax($ajax)
127:     {
128:         $this->ajax = $ajax;
129:     }
130: 
131:     /**
132:      * Obtener el codigo de respuesta HTTP
133:      * @return int
134:      */
135:     public function getResponseCode()
136:     {
137:         return $this->responseCode;
138:     }
139: 
140:     /**
141:      * Establece el codigo de respuesta HTTP
142:      * @param int $responseCode
143:      */
144:     public function setResponseCode($responseCode)
145:     {
146:         $this->responseCode = $responseCode;
147:     }
148: 
149:     
150: 
151: 
152: }
API documentation generated by ApiGen