PageRenderTime 71ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/third_party/ala_headers/pi.ala_headers.php

https://github.com/alistapart/comment-embed
PHP | 56 lines | 24 code | 11 blank | 21 comment | 1 complexity | aa76e441e0262265abc5c2b7a8dffd76 MD5 | raw file
Possible License(s): GPL-2.0, WTFPL, Apache-2.0, BSD-3-Clause, MIT
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. /**
  3. * A List Apart Headers Plugin
  4. *
  5. * @package ExpressionEngine
  6. * @subpackage Addons
  7. * @category Plugin
  8. * @author Matt Weinberg
  9. * @link http://www.vectormediagroup.com
  10. */
  11. $plugin_info = array(
  12. 'pi_name' => 'A List Apart Headers',
  13. 'pi_version' => '0.1',
  14. 'pi_author' => 'Matt Weinberg',
  15. 'pi_author_url' => 'http://www.vectormediagroup.com',
  16. 'pi_description'=> 'Sets template headers via EE tags',
  17. 'pi_usage' => Ala_headers::usage()
  18. );
  19. class Ala_headers {
  20. public $return_data;
  21. /**
  22. * Constructor
  23. */
  24. public function __construct() {
  25. $this->EE =& get_instance();
  26. }
  27. /**
  28. * Sets CORS Access-Control-Allow-Origin: * header
  29. */
  30. public function cors() {
  31. $this->EE->output->set_header('Access-Control-Allow-Origin: *');
  32. }
  33. // ----------------------------------------------------------------
  34. /**
  35. * Plugin Usage
  36. */
  37. public static function usage() {
  38. $usage = <<<HEREDOC
  39. {exp:ala_headers:cors} sets a header of "Access-Control-Allow-Origin: *" when used on a template
  40. HEREDOC;
  41. return $usage;
  42. }
  43. }
  44. /* End of file pi.ala_headers.php */
  45. /* Location: /system/expressionengine/third_party/ala_headers/pi.ala_headers.php */