本文整理汇总了PHP中Zend_Dojo_View_Helper_Dojo::useDeclarative方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Dojo_View_Helper_Dojo::useDeclarative方法的具体用法?PHP Zend_Dojo_View_Helper_Dojo::useDeclarative怎么用?PHP Zend_Dojo_View_Helper_Dojo::useDeclarative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Dojo_View_Helper_Dojo
的用法示例。
在下文中一共展示了Zend_Dojo_View_Helper_Dojo::useDeclarative方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __toString
/**
* String representation of dojo environment
*
* @return string
*/
public function __toString()
{
if (!$this->isEnabled()) {
return '';
}
$this->_isXhtml = $this->view->doctype()->isXhtml();
if (Zend_Dojo_View_Helper_Dojo::useDeclarative()) {
if (null === $this->getDjConfigOption('parseOnLoad')) {
$this->setDjConfigOption('parseOnLoad', true);
}
}
if (!empty($this->_dijits)) {
$this->registerDijitLoader();
}
$html = $this->_renderStylesheets() . PHP_EOL . $this->_renderDjConfig() . PHP_EOL . $this->_renderDojoScriptTag() . PHP_EOL . $this->_renderLayers() . PHP_EOL . $this->_renderExtras();
return $html;
}
示例2: _useDeclarative
/**
* Whether or not to use declarative dijit creation
*
* @return bool
*/
protected function _useDeclarative()
{
return Zend_Dojo_View_Helper_Dojo::useDeclarative();
}
示例3: testShouldAllowSpecifyingDeclarativeUsage
public function testShouldAllowSpecifyingDeclarativeUsage()
{
Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
$this->assertTrue(Zend_Dojo_View_Helper_Dojo::useDeclarative());
}
示例4: testShouldJsonEncodeConstraints
public function testShouldJsonEncodeConstraints()
{
$html = $this->getElement();
if (!preg_match('/constraints="(.*?)(" )/', $html, $m)) {
$this->fail('Did not serialize constraints');
}
$constraints = str_replace("'", '"', $m[1]);
if (Zend_Dojo_View_Helper_Dojo::useDeclarative()) {
// Convert ' to "'" for json_decode. See Zend_Dojo_View_Helper_Dijit::_prepareDijit() (line 254)
$constraints = str_replace(''', '"', $constraints);
}
$constraints = Zend_Json::decode($constraints);
$this->assertTrue(is_array($constraints), var_export($m[1], 1));
$this->assertTrue(array_key_exists('min', $constraints));
$this->assertTrue(array_key_exists('max', $constraints));
$this->assertTrue(array_key_exists('places', $constraints));
}
示例5: testShouldUseDeclarativeDijitCreationByDefault
public function testShouldUseDeclarativeDijitCreationByDefault()
{
$this->assertTrue(Zend_Dojo_View_Helper_Dojo::useDeclarative());
}