Sunday, July 12, 2009

Creating dojo border container in Zend Framework

Try Online : Border Container
In my previous artilce I discuss how to create accordion container and panes. If you wish to create accordion container and panes, read my article "Creating dojo accordion Container in Zend".
If you don't know how to configure dojo and Zend Framework, read here.
In this article, however I am going to discuss how to create border container. Border continer divide our page in different section so that we can display different contents in those sectitons.

To create the border container we first need to create our controller as


<?php
class ContainerController extends Zend_Controller_Action
{
public function borderAction()
{

}
}


Now in your /application/views/scripts/container/border.phtml, place the following code.
<?php

$this->borderContainer()->captureStart('main-container',
array('design' => 'headline'),
array(
'style'=>'height:400px;width:800px',
'align' => 'center'
));

echo $this->contentPane(
'menuPane',
'This is the menu pane',
array('region' => 'top'),
array('style' => 'background-color: darkblue;color:white')
);

echo $this->contentPane(
'navPane',
'This is the navigation pane',
array('region' => 'left'),
array('style' => 'width: 200px; background-color: lightblue;')
);

echo $this->contentPane(
'mainPane',
'This is the main content pane area',
array('region' => 'center'),
array('style' => 'background-color: white;')
);

echo $this->contentPane(
'statusPane',
'Status area',
array('region' => 'bottom'),
array('style' => 'background-color: lightgray;')
);

echo $this->borderContainer()->captureEnd('main-container');
?>


Here we have called captureStart() method to start our border container, and then we have placed different content panes.
Each content pane has an "id", "contents" it holds, array containing content panes attributes, and an array containing css attributes.

2 comments: