Created
October 26, 2012 20:20
-
-
Save Hounddog/3961251 to your computer and use it in GitHub Desktop.
JGrid Logic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->headScript()->append('my.js'); | |
?> | |
implement the javascripthere | |
<?php | |
foreach(data['cols'] as $colum) { | |
echo 'generating some columns'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\View\Helper; | |
use Zend\View\Helper\AbstractHelper; | |
use Zend\View\Model\ViewModel; | |
use Zend\ServiceManager\ServiceManagerAwareInterface; | |
use Zend\ServiceManager\ServiceManager; | |
class JGridView extends AbstractHelper implements ServiceManagerAwareInterface | |
{ | |
protected $serviceManager; | |
protected $viewTemplate; | |
public function __invoke($options) | |
{ | |
//get data here or data from service manager | |
$vm = new ViewModel(); | |
$vm->setTemplate('application/jgrid-view.phtml'); | |
return $this->getView()->render($vm); | |
} | |
public function setViewTemplate($viewTemplate) | |
{ | |
$this->viewTemplate = $viewTemplate; | |
return $this; | |
} | |
//getter/setter service Manager | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo jGridView(array('url' => 'url/to/fetch/from', 'layout' => $this->jgridLayout[1]); ?> | |
<!-- i will put as many grids here as i wish and the controller cannot stop me! --> | |
?php echo jGridView(array('url' => 'url/to/fetch/from', 'layout' => $this->jgridLayout[2]); ?> | |
?php echo jGridView(array('url' => 'url/to/fetch/from', 'layout' => $this->jgridLayout[3]); ?> | |
?php echo jGridView(array('url' => 'url/to/fetch/from', 'layout' => $this->jgridLayout[4]); ?> | |
?php echo jGridView(array('url' => 'url/to/fetch/from', 'layout' => $this->jgridLayout[5]); ?> | |
?php echo jGridView(array('url' => 'url/to/fetch/from', 'layout' => $this->jgridLayout[6]); ?> | |
?php echo jGridView(array('url' => 'url/to/fetch/from', 'layout' => $this->jgridLayout[7]); ?> | |
?php echo jGridView(array('url' => 'url/to/fetch/from', 'layout' => $this->jgridLayout[8]); ?> | |
?php echo jGridView(array('url' => 'url/to/fetch/from', 'layout' => $this->jgridLayout[9]); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment