Zend Framework 2 Controller Example(zf2)
Zend Framework 2 Controller Example(zf2)
<?php
namespace Admin\Controller;
use Zend\View\Model\ViewModel;
use Zend\Db\Sql\Select;
use Zend\View\Model\JsonModel;
use Zend\Session\Container;
use Zend\Session\SessionManager;
use Admin\Model\UsefullSiteReview;
use Admin\Model\UsefullSiteReviewTable;
use Admin\Model\TaskQue;
use Admin\Model\TaskQueTable;
use Admin\Model\CategoryOrganizationTable;
require_once 'google/appengine/api/cloud_storage/CloudStorageTools.php';
use google\appengine\api\cloud_storage\CloudStorageTools;
class CategoryController extends BaseController {
private $categoryIdsToUnset = [];
public function indexAction() {
$baseCategories = $this->getCategoryTable()->getColumnsMultipleCondition(['baseCategory' => 9, 'status' => 13]);
$arrNestedBaseCategories = $this->categoryArray($baseCategories);
$this->layout()->activePage = 'indexCategory';
$this->layout()->activeTab = 'category';
return new ViewModel(array(
'baseCategories' => $arrNestedBaseCategories,
));
}
public function containerAction() {
$category = $this->getCategoryTable()->getColumnsMultipleCondition(['parentId' => 0, 'status' => 13]);
$this->layout()->activePage = 'container';
$this->layout()->activeTab = 'category';
return new ViewModel(array(
'category' => (isset($category[0]) && !empty($category[0])) ? $category[0] : array(),
//'categoryIdsToUnset' => $this->categoryIdsToUnset
));
}
}
Zend Framework 2 Controller Example(zf2)
Reviewed by Dhaneshwar
on
10:45:00 PM
Rating:
No comments: