Hello,
I'm new to ZF and am trying to build a simple project using the ZEND_DOJO.
I started by completing the quickstart and all is working as expected.
I've gone over several different pages that describe how to setup dojo but I
can't seem to make it display the dijits as expected. Basically I'm trying
to setup a layout using the dijit BorderContainer and ContentPane. firebug
tells me that dojo is being loaded, but the created elements are just
regular div and not dojoized (for lack of a better term). The only way I've
been able to get dojo widgets is to use the HTML declaration. This proved
that dojo is loading correctly and it must be something about my php code.
Here is my code
Bootstrap.php
[code]<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initAutoload()
{
$autoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'Default',
'basePath' => dirname(__FILE__),
));
return $autoloader;
}
protected function _initDoctype()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->doctype('XHTML1_STRICT');
}
protected function _initViewHelpers()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->addHelperPath('Zend/Dojo/View/Helper/',
'Zend_Dojo_View_Helper');
$viewRenderer = new
Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
}
public function init()
{
Zend_Dojo::enableView($view);
$view->dojo()->setDjConfigOption('parseOnLoad', true)
->setDjConfigOption('usePlainJson',true)
->setCdnBase(Zend_Dojo::CDN_BASE_GOOGLE)
->setCdnVersion("1.3.2")
->addStyleSheetModule('dijit.themes.tundra')
->disable();
}
}
[/code]
application/layouts/scripts/layout.phtml
[code]
<?php
// application/layouts/scripts/layout.phtml
echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Webspace</title>
<?php
//$this->addHelperPath('Zend/Dojo/View/Helper/',
'Zend_Dojo_View_Helper');
$this->dojo()->enable()
->addStyleSheetModule('dijit.themes.tundra');
echo $this->dojo();
// ->setCdnBase(Zend_Dojo::CDN_BASE_GOOGLE)
// ->setCdnVersion("1.3.2")
//
->setLocalPath('dojo-1.3.1/dojo/dojo.js')
/* appead the local css file */
echo $this->headLink()->appendStylesheet('css/global.css')
?>
</head>
<body class="tundra">
<?php
$this->borderContainer()->captureStart('masterLayout',
array('design' => 'headline'));
echo $this->contentPane(
'menuPane',
'This is the menu pane',
array('region' => 'top'),
array('style' => 'background-color: darkblue;')
);
echo $this->contentPane(
'navPane',
'This is the navigation pane',
array('region' => 'left'),
array('style' => 'width: 200px; background-color: lightblue;')
);
echo $this->contentPane(
'mainPane',
$this->layout()->content ,
array('region' => 'center'),
array('style' => 'background-color: white;')
);
echo $this->contentPane(
'statusPane',
'This is the status pane',
array('region' => 'bottom'),
array('style' => 'background-color: lightgray;')
);
echo $this->borderContainer()->captureEnd('masterLayout');
?>
</body>
</html>
[/code]
Resulting HTML
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html
xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Webspace</title>
<style type="text/css">
<!--
@import
"http://ajax.googleapis.com/ajax/libs/dojo/1.2.0/dijit/themes/tundra/tundra.css";
-->
</style>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/dojo/1.2.0/dojo/dojo.xd.js"></script>
<link href="css/global.css" media="screen" rel="stylesheet" type="text/css"
/></head>
<body class="tundra">
<div id="masterLayout"><div style="background-color: darkblue;"
id="menuPane">This is the menu pane</div>
<div style="width: 200px; background-color: lightblue;" id="navPane">This is
the navigation pane</div>
<div style="background-color: white;" id="mainPane"><h1> this is the
index.phtml stuff</h1></div>
<div style="background-color: lightgray;" id="statusPane">This is the status
pane</div>
</div>
</body>
</html>
[/code]
Thanks for reading
--
View this message in context:
http://www.nabble.com/Zend-Dojo-Dijit-layout-issue-using-Zend_Dojo_View_Helper-tp24596067p24596067.html
Sent from the Zend Framework mailing list archive at Nabble.com.