InlineScript.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. * @package Zend_View
  16. * @subpackage Helper
  17. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @version $Id$
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /** Zend_View_Helper_HeadScript */
  22. require_once 'Zend/View/Helper/HeadScript.php';
  23. /**
  24. * Helper for setting and retrieving script elements for inclusion in HTML body
  25. * section
  26. *
  27. * @uses Zend_View_Helper_Head_Script
  28. * @package Zend_View
  29. * @subpackage Helper
  30. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. */
  33. class Zend_View_Helper_InlineScript extends Zend_View_Helper_HeadScript
  34. {
  35. /**
  36. * Registry key for placeholder
  37. * @var string
  38. */
  39. protected $_regKey = 'Zend_View_Helper_InlineScript';
  40. /**
  41. * Return InlineScript object
  42. *
  43. * Returns InlineScript helper object; optionally, allows specifying a
  44. * script or script file to include.
  45. *
  46. * @param string $mode Script or file
  47. * @param string $spec Script/url
  48. * @param string $placement Append, prepend, or set
  49. * @param array $attrs Array of script attributes
  50. * @param string $type Script type and/or array of script attributes
  51. * @return Zend_View_Helper_InlineScript
  52. */
  53. public function inlineScript($mode = Zend_View_Helper_HeadScript::FILE, $spec = null, $placement = 'APPEND', array $attrs = array(), $type = 'text/javascript')
  54. {
  55. return $this->headScript($mode, $spec, $placement, $attrs, $type);
  56. }
  57. }