File indexing completed on 2025-01-26 05:30:00
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Tool 0017 * @subpackage Framework 0018 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0019 * @license http://framework.zend.com/license/new-bsd New BSD License 0020 * @version $Id$ 0021 */ 0022 0023 /** 0024 * This class is the front most class for utilizing Zend_Tool_Project 0025 * 0026 * A profile is a hierarchical set of resources that keep track of 0027 * items within a specific project. 0028 * 0029 * @category Zend 0030 * @package Zend_Tool 0031 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0032 * @license http://framework.zend.com/license/new-bsd New BSD License 0033 */ 0034 class Zend_Tool_Project_Context_Content_Engine_Phtml 0035 { 0036 0037 /** 0038 * @var Zend_Tool_Framework_Client_Storage 0039 */ 0040 protected $_storage = null; 0041 0042 /** 0043 * @var string 0044 */ 0045 protected $_contentPrefix = null; 0046 0047 /** 0048 * __construct() 0049 * 0050 * @param Zend_Tool_Framework_Client_Storage $storage 0051 * @param string $contentPrefix 0052 */ 0053 public function __construct(Zend_Tool_Framework_Client_Storage $storage, $contentPrefix) 0054 { 0055 $this->_storage = $storage; 0056 $this->_contentPrefix = $contentPrefix; 0057 } 0058 0059 /** 0060 * hasContext() 0061 * 0062 * @param Zend_Tool_Project_Context_Interface $context 0063 * @param string $method 0064 * @return string 0065 */ 0066 public function hasContent(Zend_Tool_Project_Context_Interface $context, $method) 0067 { 0068 return $this->_storage->has($this->_contentPrefix . '/' . $context . '/' . $method . '.phtml'); 0069 } 0070 0071 /** 0072 * getContent() 0073 * 0074 * @param Zend_Tool_Project_Context_Interface $context 0075 * @param string $method 0076 * @param mixed $parameters 0077 */ 0078 public function getContent(Zend_Tool_Project_Context_Interface $context, $method, $parameters) 0079 { 0080 $streamUri = $this->_storage->getStreamUri($this->_contentPrefix . '/' . $context->getName() . '/' . $method . '.phtml'); 0081 0082 ob_start(); 0083 include $streamUri; 0084 $content = ob_get_clean(); 0085 0086 return $content; 0087 } 0088 0089 }