本文整理汇总了PHP中Zend_View_Interface类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Interface类的具体用法?PHP Zend_View_Interface怎么用?PHP Zend_View_Interface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_View_Interface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enableView
/**
* jQuery-enable a view instance
*
* @param \Zend_View_Interface $view
* @return void
*/
public static function enableView(\Zend_View_Interface $view)
{
if (false === $view->getPluginLoader('helper')->getPaths('MUtil_JQuery_View_Helper')) {
$view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
$view->addHelperPath('MUtil/JQuery/View/Helper', 'MUtil_JQuery_View_Helper');
}
}
示例2: plug
/**
* Assign the plugin to the view
*
* @param Zend_View_Interface $view
*/
public function plug(Zend_View_Interface $view)
{
$view->addBasePath($this->getTemplatePath());
if (!isset($view->plugins)) {
$view->plugins = array();
}
$view->plugins[$this->getPHTML()] = $this->getDataArray();
}
示例3: renderLabel
public function renderLabel(Zend_Form_Element $element, Zend_View_Interface $view)
{
$label = $element->getLabel();
if (empty($label)) {
$label = $element->getName();
}
return '<div class="pointer" onClick = goToErrorLabel(\'' . $element->getId() . '\')>' . $this->getMarkupElementLabelStart() . $view->escape($label) . $this->getMarkupElementLabelEnd() . '</div>';
}
示例4: __construct
/**
* @param TemplateLocatorInterface $locator
* @param ContainerInterface $container
* @param TemplateNameParserInterface $parser
* @param Zend_View_Interface $zendView
*/
public function __construct(FileLocatorInterface $locator, ContainerInterface $container, TemplateNameParserInterface $parser, $zendView)
{
$this->locator = $locator;
$this->container = $container;
$this->parser = $parser;
$this->view = $zendView;
// Zend View is not able to handle absolute paths except with this little trick
$this->view->setScriptPath('');
}
示例5: setView
public function setView(Zend_View_Interface $view = null)
{
if (null !== $view) {
if (false === $view->getPluginLoader('helper')->getPaths('Ynresponsiveevent_Widget_EventFooterAbout_View_Helper')) {
$view->addHelperPath(APPLICATION_PATH . '/application/modules/Ynresponsiveevent/widgets/event-footer-about/View/Helper', 'Ynresponsiveevent_Widget_EventFooterAbout_View_Helper');
}
}
return parent::setView($view);
}
示例6: getHtml
/**
*
* @static
* @param string $value
* @param Zend_View_Interface $view
* @return string
*/
public static function getHtml($value, Zend_View_Interface $view = null)
{
$value = Zend_Json_Decoder::decode($value);
$html = '';
foreach (self::_getOptions() as $options) {
$html .= $options['name'] . ' ' . $view->formText('confValue[' . $options['name'] . ']', $value[$options['id']], array('size' => '50'));
}
return $html;
}
示例7: setView
/**
* Set the view object
*
* Ensures that the view object has the dojo view helper path set.
*
* @param Zend_View_Interface $view
* @return Zend_Dojo_Form_Element_Dijit
*/
public function setView(Zend_View_Interface $view = null)
{
if (null !== $view) {
if (false === $view->getPluginLoader('helper')->getPaths('Zend_Dojo_View_Helper')) {
$view->addHelperPath('Zend/Dojo/View/Helper', 'Zend_Dojo_View_Helper');
}
}
return parent::setView($view);
}
示例8: checkSkinStyles
/**
*
*/
public function checkSkinStyles($name, $values)
{
$config = Zend_Registry::get('config');
$basePath = $config->design->pathToSkins;
$xhtml = array();
$this->view->name = $name;
$this->view->selectedStyles = $values;
//load the skin folders
if (is_dir('./' . $basePath)) {
$folders = Digitalus_Filesystem_Dir::getDirectories('./' . $basePath);
if (count($folders) > 0) {
foreach ($folders as $folder) {
$this->view->skin = $folder;
$styles = Digitalus_Filesystem_File::getFilesByType('./' . $basePath . '/' . $folder . '/styles', 'css');
if (is_array($styles)) {
foreach ($styles as $style) {
//add each style sheet to the hash
// key = path / value = filename
$hashStyles[$style] = $style;
}
$this->view->styles = $hashStyles;
$xhtml[] = $this->view->render($this->partialFile);
unset($hashStyles);
}
}
}
} else {
throw new Zend_Acl_Exception('Unable to locate skin folder');
}
return implode(null, $xhtml);
}
示例9: pagination
/**
* Generates a list of pagination links
*
* @param QFrame_Paginator paginator object
* @param string (optional) action to use for page link
* @param string (optional) variable to use for page number
* @param Array (optional) list of additional parameters to add to each link
* @return string
*/
public function pagination($pager, $action = 'page', $pageNum = 'id', $params = array())
{
if (count($pager->pageNumbers()) <= 1) {
return '';
}
$controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
$b = new Tag_Builder();
$content = '';
// set up an array of arguments that are common to all links
$linkArgs = array_merge($params, array('controller' => $controller, 'action' => $action));
// print out links to each page number (unless it is the current page number
// in which case print out just the number, no link)
foreach ($pager->pageNumbers() as $page) {
if ($page == $pager->currentNumber()) {
$pageContent = "{$page} ";
} else {
$linkArgs[$pageNum] = $page;
$pageContent = $this->_view->linkTo($linkArgs, "{$page}") . ' ';
}
$content .= $b->li($pageContent);
}
// prepend a previous page link if there is/are previous page(s), otherwise
// just the equivalent text
if ($pager->currentNumber() > 1) {
$linkArgs[$pageNum] = $pager->currentNumber() - 1;
$content = $b->li($this->_view->linkTo($linkArgs, '< prev'), ' ', $content);
}
// append a next page link if there is/are next page(s), otherwise just
// the equivalent text
if ($pager->currentNumber() < $pager->lastPageNumber()) {
$linkArgs[$pageNum] = $pager->currentNumber() + 1;
$content .= $b->li($this->_view->linkTo($linkArgs, 'next >'), ' ');
}
return $b->ol(array('class' => 'pagination'), $content);
}
示例10: isValid
/**
* Make sure the user is valid
*
* @return void
*/
public function isValid($value)
{
$valid = true;
$this->_user = $value;
$namePartsValidator = new Zend_Validate();
$namePartsValidator->addValidator(new Zend_Validate_NotEmpty(Zend_Validate_NotEmpty::STRING))->addValidator(new Zend_Validate_Alpha(array('allowWhiteSpace' => true)))->addValidator(new Zend_Validate_StringLength(array('min' => 2)));
if (!$namePartsValidator->isValid($this->_user->getFirstName())) {
$valid = false;
$this->_error($this->_view->translate('The first name must have at least 2 characters and consist only of letters'));
}
if (!$namePartsValidator->isValid($this->_user->getLastName())) {
$valid = false;
$this->_error($this->_view->translate('The last name must have at least 2 characters and consist only of letters'));
}
$emailValidator = new Zend_Validate_EmailAddress();
if (!$emailValidator->isValid($this->_user->getEmail())) {
$valid = false;
$this->_error($this->_view->translate('You must entre a valid email'));
}
if ($this->_user->isNew()) {
$usernameValidator = new Zend_Validate();
$usernameValidator->addValidator(new Zend_Validate_NotEmpty(Zend_Validate_NotEmpty::STRING))->addValidator(new Zend_Validate_Alnum(array('allowWhiteSpace' => false)))->addValidator(new Zend_Validate_StringLength(array('min' => 5)));
if (!$usernameValidator->isValid($this->_user->getUsername())) {
$this->_error($this->_view->translate('The username must have at least 5 characters and contains no white spaces'));
}
}
return $valid;
}
示例11: expireHeader
/**
* Constructor do Helper. Utilizado para setar o quando deve-se adicionar ao timestamp da data atual.
* @param $dias
* @param $meses
* @param $anos
*/
public function expireHeader($dias = 10, $meses = 0, $anos = 0)
{
$this->timestamp = mktime(date('H'), date('i'), date('s'), date('m') + $meses, date('d') + $dias, date('Y') + $anos);
$this->view->headMeta()->appendName('expires', date('r', $this->timestamp));
$this->view->headMeta()->appendHttpEquiv('Expires', date('r', $this->timestamp));
return null;
}
示例12: indexAction
public function indexAction()
{
// STAGE 3: Choose, create, and optionally update models using business logic.
$cities = parse_ini_file('cities.ini');
// $cities contains our simple data model
// STAGE 4: Apply business logic to create a presentation model for the view.
ksort($_SERVER);
$this->_view->SERVER = $_SERVER;
$this->_view->date = date('Y-m-d H:i:s');
$this->_view->cities = array();
$this->_view->distances = array();
if (isset($_REQUEST['distance'])) {
$maxDistance = intval($_REQUEST['distance']);
} else {
$this->_redirect('/?distance=10000');
}
$this->_view->maxDistance = $maxDistance;
foreach ($cities as $city => $distance) {
// business logic specifies to filter the data model satisfying distance criteria
if ($distance < $maxDistance) {
$this->_view->cities[] = $city;
$this->_view->distances[] = $distance;
#echo "Distance from London, UK to $city is $distance km.<br>\n";
}
}
// STAGE 5: Choose view and submit presentation model to view.
$this->_response->appendBody($this->_view->render('indexIndex.phtml'));
}
示例13: getParamArr
public function getParamArr()
{
foreach ((array) $this->_emailContent->getViewAssignments() as $assign) {
$this->_view->assign($assign[0], $assign[1]);
}
$arr = array('password' => self::VALIDATION_PASSWORD, 'to' => $this->_emailContent->getTo(), 'subject' => $this->_emailContent->getSubject(), 'body' => $this->renderBody($this->_emailContent->getViewScript()));
return $arr;
}
示例14: stringifyCall
/**
* Returns a readable version of a call in a stack trace (returned by Exception->getTrace())
*
* @param Array single call in the call stack
* @return string
*/
public function stringifyCall($call)
{
$string = "{$this->relativizePath($call['file'])}({$call['line']}): ";
if (isset($call['class'])) {
$string .= "{$call['class']}{$call['type']}";
}
$string .= "{$call['function']}({$this->stringifyParameters($call)})";
return $this->view->h($string);
}
示例15: escapeCheckEmpty
/**
* Fungsi escapeCheckEmpty
*
* @param string $date tanggal yang mau diformat
* @param integer $format jenis format yang mau dilakukan
*
* @return string tanggal yang sudah diformat
*/
public function escapeCheckEmpty($input)
{
$output = '';
if (empty($input)) {
$output = '-';
} else {
$output = $this->view->escape($input);
}
return $output;
}