Mercurial > hg > isophonics-drupal-site
annotate vendor/jcalderonzumba/gastonjs/src/Browser/BrowserHeadersTrait.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Zumba\GastonJS\Browser; |
Chris@0 | 4 |
Chris@0 | 5 /** |
Chris@0 | 6 * Trait BrowserHeadersTrait |
Chris@0 | 7 * @package Zumba\GastonJS\Browser |
Chris@0 | 8 */ |
Chris@0 | 9 trait BrowserHeadersTrait { |
Chris@0 | 10 /** |
Chris@0 | 11 * Returns the headers of the current page that will be used the next request |
Chris@0 | 12 * @return mixed |
Chris@0 | 13 */ |
Chris@0 | 14 public function getHeaders() { |
Chris@0 | 15 return $this->command('get_headers'); |
Chris@0 | 16 } |
Chris@0 | 17 |
Chris@0 | 18 /** |
Chris@0 | 19 * Given an array of headers, set such headers for the requests, removing all others |
Chris@0 | 20 * @param array $headers |
Chris@0 | 21 * @return mixed |
Chris@0 | 22 */ |
Chris@0 | 23 public function setHeaders($headers) { |
Chris@0 | 24 return $this->command('set_headers', $headers); |
Chris@0 | 25 } |
Chris@0 | 26 |
Chris@0 | 27 /** |
Chris@0 | 28 * Adds headers to current page overriding the existing ones for the next requests |
Chris@0 | 29 * @param $headers |
Chris@0 | 30 * @return mixed |
Chris@0 | 31 */ |
Chris@0 | 32 public function addHeaders($headers) { |
Chris@0 | 33 return $this->command('add_headers', $headers); |
Chris@0 | 34 } |
Chris@0 | 35 |
Chris@0 | 36 /** |
Chris@0 | 37 * Adds a header to the page making it permanent if needed |
Chris@0 | 38 * @param $header |
Chris@0 | 39 * @param $permanent |
Chris@0 | 40 * @return mixed |
Chris@0 | 41 */ |
Chris@0 | 42 public function addHeader($header, $permanent = false) { |
Chris@0 | 43 return $this->command('add_header', $header, $permanent); |
Chris@0 | 44 } |
Chris@0 | 45 |
Chris@0 | 46 /** |
Chris@0 | 47 * Gets the response headers after a request |
Chris@0 | 48 * @return mixed |
Chris@0 | 49 */ |
Chris@0 | 50 public function responseHeaders() { |
Chris@0 | 51 return $this->command('response_headers'); |
Chris@0 | 52 } |
Chris@0 | 53 } |