InlineScript.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_View
  17. * @subpackage Helper
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @version $Id$
  20. * @license http://framework.zend.com/license/new-bsd New BSD License
  21. */
  22. /** Zend_View_Helper_HeadScript */
  23. require_once 'Zend/View/Helper/HeadScript.php';
  24. /**
  25. * Helper for setting and retrieving script elements for inclusion in HTML body
  26. * section
  27. *
  28. * @uses Zend_View_Helper_Head_Script
  29. * @package Zend_View
  30. * @subpackage Helper
  31. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  32. * @license http://framework.zend.com/license/new-bsd New BSD License
  33. */
  34. class Zend_View_Helper_InlineScript extends Zend_View_Helper_HeadScript
  35. {
  36. /**
  37. * Registry key for placeholder
  38. * @var string
  39. */
  40. protected $_regKey = 'Zend_View_Helper_InlineScript';
  41. /**
  42. * Return InlineScript object
  43. *
  44. * Returns InlineScript helper object; optionally, allows specifying a
  45. * script or script file to include.
  46. *
  47. * @param string $mode Script or file
  48. * @param string $spec Script/url
  49. * @param string $placement Append, prepend, or set
  50. * @param array $attrs Array of script attributes
  51. * @param string $type Script type and/or array of script attributes
  52. * @return Zend_View_Helper_InlineScript
  53. */
  54. public function inlineScript($mode = Zend_View_Helper_HeadScript::FILE, $spec = null, $placement = 'APPEND', array $attrs = array(), $type = 'text/javascript')
  55. {
  56. return $this->headScript($mode, $spec, $placement, $attrs, $type);
  57. }
  58. }