Ejemplo n.º 1
0
 public function __construct(Application $application, $charset = null, Headers $headers = null, Cookies $cookies = null, TemplateParams $params = null)
 {
     parent::__construct($charset, $headers, $cookies);
     if (null === $params) {
         $params = new TemplateParams();
     }
     $this->setApplication($application)->setParams($params);
 }
Ejemplo n.º 2
0
 public function __construct(Application $application, $charset = null, Headers $headers = null, ResponseCookies $cookies = null)
 {
     parent::__construct($charset, $headers, $cookies);
     $this->setApplication($application)->setTitle($application->getName());
 }
Ejemplo n.º 3
0
 protected function createRequestPanel(Request $request, HtmlResponse $response)
 {
     $sources = [["label" => "Query", "params" => $request->getQueryParams()], ["label" => "Data", "params" => $request->getDataParams()], ["label" => "Cookies", "params" => $request->getCookies()], ["label" => "Server", "params" => $request->getServerParams()]];
     $counter = 0;
     $content = '
         <table>
     ';
     foreach ($sources as $source) {
         $count = count($source["params"]);
         $counter += $count;
         $content .= '
                 <tr>
                     <th colspan="2">' . $response->esc($source["label"]) . '</th>
                 </tr>
         ';
         if ($count > 0) {
             foreach ($source["params"] as $key => $value) {
                 $content .= '
                     <tr>
                         <td class="panadas-text-right">' . $response->esc($key) . '</td>
                         <td class="panadas-text-info" width="100%">' . $response->esc($value) . '</td>
                     </tr>
                 ';
             }
         } else {
             $content .= '
                 <tr>
                     <td></td>
                     <td class="panadas-text-muted">No parameters provided</td>
                 </tr>
             ';
         }
     }
     $content .= '
         </table>
     ';
     return ["label" => "Request", "counter" => $counter, "content" => $content];
 }