本文整理汇总了PHP中Zend_Form_Element_File::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_File::render方法的具体用法?PHP Zend_Form_Element_File::render怎么用?PHP Zend_Form_Element_File::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_File
的用法示例。
在下文中一共展示了Zend_Form_Element_File::render方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMarkerInterfaceForFileElement
public function testMarkerInterfaceForFileElement()
{
$this->element->setDecorators(array('ViewHelper'));
$this->assertEquals(1, count($this->element->getDecorators()));
try {
$content = $this->element->render(new Zend_View());
$this->fail();
} catch (Zend_Form_Element_Exception $e) {
$this->assertContains('No file decorator found', $e->getMessage());
}
}
示例2: testCanChangeViewHelper
/**
* @group ZF-10519
*/
public function testCanChangeViewHelper()
{
$element = new Zend_Form_Element_File('foo');
$element->setView($this->getView());
// Get output using default view helper
$defaultOutput = $element->render();
// Get output using mock view helper
$element->helper = "formFileMock";
$mockOutput = $element->render();
// Ensure the view helper was changed
$this->assertRegexp('/FormFileMock/s', $mockOutput);
$this->assertNotEquals($defaultOutput, $mockOutput);
}
示例3: render
/**
* Render form element
*
* @param Zend_View_Interface $view
* @return string
*/
public function render(Zend_View_Interface $view = null)
{
$this->setBootstrapConfiguration();
return $this->bsUtils->divFormGroup(parent::render($view));
}
示例4: foreach
<?php
/*
PHP 5.2.0
ZF 1.6.2
running this script throws the following in Zend_File_Transfer_Adapter_Abstract on my machine:
PHP Notice:
Undefined variable: result in /Users/michel/web-lib/ZendFramework-1.6.2-minimal/library/Zend/File/Transfer/Adapter/Abstract.php on line 803
PHP Warning: Invalid argument supplied for foreach() in /Users/michel/web-lib/ZendFramework-1.6.2-minimal/library/Zend/Form/Element.php on line 524
*/
// edit as required:
set_include_path('/Users/michel/web-lib/ZendFramework-1.6.2-minimal/library');
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
$element = new Zend_Form_Element_File('test');
$element->setDecorators(array('ViewHelper'));
$element->setDestination('/tmp');
$element->clearFilters();
$element->render(new Zend_View());