当前位置: 首页>>代码示例>>PHP>>正文


PHP Grid类代码示例

本文整理汇总了PHP中Grid的典型用法代码示例。如果您正苦于以下问题:PHP Grid类的具体用法?PHP Grid怎么用?PHP Grid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Grid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: writeGrid

 public function writeGrid(Grid $grid)
 {
     if (!$grid->isLoaded()) {
         $this->Torpor()->throwException($this->Torpor()->containerKeyName($grid) . ' grid not loaded (can only cache loaded grids)');
     }
     return $this->_memcache->set($this->makeGridKey($grid), $grid->dumpArray(true), $this->getCompression() ? MEMCACHE_COMPRESSED : null, $this->getTTL());
 }
开发者ID:codegooglecom,项目名称:torpor-php,代码行数:7,代码来源:TorporMemcache.php

示例2: indexAction

 public function indexAction()
 {
     $page = $this->request->queryString("page");
     if (empty($page)) {
         $page = "1";
     }
     $model = $this->model->get('feedback');
     $totalRecord = $model->getTotalRecord(1);
     $this->view->data['page'] = $page;
     $this->view->data['totalRecord'] = $totalRecord;
     $this->view->data['pageSize'] = 10;
     $this->view->data['users'] = $model->getAll($page, $this->view->data['pageSize'], null);
     $grid = new Grid($this->view->data['users']);
     $grid->setModule('admin');
     $grid->setController('feedback');
     $grid->setTotalRecord($totalRecord);
     $grid->setPageSize($this->view->data['pageSize']);
     $grid->setPage($page);
     $grid->addColumn(array('header' => 'ID', 'align' => 'center', 'width' => '', 'index' => 'id'));
     $grid->addColumn(array('header' => 'Họ tên', 'align' => 'left', 'width' => '', 'index' => 'fullname'));
     $grid->addColumn(array('header' => 'Thư điện tử', 'align' => 'center', 'width' => '', 'index' => 'email'));
     $grid->addColumn(array('header' => 'Điện thoại', 'align' => 'center', 'width' => '', 'index' => 'phone'));
     $this->view->data['grid'] = $grid;
     $this->view->show('index');
 }
开发者ID:phithienthan,项目名称:vnitc,代码行数:25,代码来源:feedbackController.php

示例3: index

 public function index()
 {
     if (!isAuth(209)) {
         return;
     }
     $this->view->clientsJS("matiere" . DS . "index");
     $matieres = $this->Matiere->selectAll();
     /* $this->Assign("content", (new View())->output(
        array('matieres' => $matieres,
        'errors' => false), false)); */
     $grid = new Grid($matieres, 0);
     $grid->addcolonne(0, 'IDMATIERE', 'IDMATIERE', false);
     $grid->addcolonne(1, 'Code', 'CODE', TRUE);
     $grid->addcolonne(2, 'Libellé', 'LIBELLE', TRUE);
     $grid->droitdelete = 515;
     $grid->droitedit = 514;
     $grid->editbutton = true;
     $grid->dataTable = "tableMatieres";
     $grid->editbuttontext = "Editer";
     $grid->deletebutton = true;
     $grid->deletebuttontext = "Supprimer";
     $grid->selectbutton = false;
     $total = count($matieres);
     $this->Assign("content", (new View())->output(array("matieres" => $grid->display(), "errors" => false, "total" => $total), false));
 }
开发者ID:jpainam,项目名称:cosba,代码行数:25,代码来源:matiereController.php

示例4: indexAction

 public function indexAction()
 {
     $page = $this->request->queryString("page");
     if (empty($page)) {
         $page = "1";
     }
     $userModel = $this->model->get('user');
     $totalRecord = $userModel->getTotalRecord(1);
     $this->view->data['page'] = $page;
     $this->view->data['totalRecord'] = $totalRecord;
     $this->view->data['pageSize'] = 10;
     $this->view->data['users'] = $userModel->getUser($page, $this->view->data['pageSize'], null);
     $grid = new Grid($this->view->data['users']);
     $grid->setModule('admin');
     $grid->setController('user');
     $grid->setTotalRecord($totalRecord);
     $grid->setPageSize($this->view->data['pageSize']);
     $grid->setPage($page);
     $grid->addColumn(array('header' => 'ID', 'align' => 'center', 'width' => '', 'index' => 'id'));
     $grid->addColumn(array('header' => 'Tên truy cập', 'align' => 'left', 'width' => '', 'index' => 'username'));
     $grid->addColumn(array('header' => 'Tên hiển thị', 'align' => 'center', 'width' => '', 'index' => 'display_name'));
     $grid->addColumn(array('header' => 'Email', 'align' => 'center', 'width' => '', 'index' => 'email'));
     $this->view->data['grid'] = $grid;
     $this->view->show('index');
 }
开发者ID:phithienthan,项目名称:vnitc,代码行数:25,代码来源:contactController.php

示例5: RenderGrid

 function RenderGrid(Grid $grid)
 {
     $hiddenValues = array(OPERATION_PARAMNAME => OPERATION_COMMIT);
     AddPrimaryKeyParametersToArray($hiddenValues, $grid->GetDataset()->GetPrimaryKeyValues());
     $template = $grid->GetPage()->GetCustomTemplate(PagePart::VerticalGrid, PageMode::Edit, 'edit/grid.tpl');
     $this->DisplayTemplate($template, array('Grid' => $grid->GetEditViewData($this)), array('Authentication' => $grid->GetPage()->GetAuthenticationViewData(), 'HiddenValues' => $hiddenValues));
 }
开发者ID:howareyoucolin,项目名称:demo,代码行数:7,代码来源:edit_renderer.php

示例6: helper_not_in_wh_pr_grid_build

function helper_not_in_wh_pr_grid_build(Grid $grid, $wh_id)
{
    $grid->add_column(array('index' => 'sku', 'searchtable' => 'A', 'type' => 'text', 'tdwidth' => '15%', 'filter' => true), 'Артикул');
    $grid->add_column(array('index' => 'name', 'searchtable' => 'B', 'type' => 'text', 'filter' => true), 'Название');
    $grid->add_column(array('index' => 'status', 'searchtable' => 'A', 'type' => 'select', 'options' => array('' => '', '0' => 'Нет', '1' => 'Да'), 'tdwidth' => '9%', 'filter' => true), 'В поиске');
    $grid->add_column(array('index' => 'action', 'type' => 'action', 'tdwidth' => '10%', 'option_string' => 'align="center"', 'sortable' => false, 'filter' => false, 'actions' => array(array('type' => 'link', 'html' => '', 'href' => set_url(array('warehouse', 'warehouses_products', 'add_exist_pr', 'wh_id', $wh_id, 'pr_id', '$1')), 'href_values' => array('ID'), 'options' => array('class' => 'icon_plus', 'title' => 'Добавить выбраный продукт')))), 'Действие');
}
开发者ID:vitalik199415,项目名称:ozar,代码行数:7,代码来源:warehouses_products_helper.php

示例7: RenderGrid

 public function RenderGrid(Grid $grid)
 {
     $hiddenValues = array(OPERATION_PARAMNAME => OPERATION_COMMIT_INSERT);
     $customParams = array();
     $template = $grid->GetPage()->GetCustomTemplate(PagePart::VerticalGrid, PageMode::Insert, 'insert/grid.tpl', $customParams);
     $this->DisplayTemplate($template, array('Grid' => $grid->GetInsertViewData($this)), array_merge($customParams, array('Authentication' => $grid->GetPage()->GetAuthenticationViewData(), 'HiddenValues' => $hiddenValues)));
 }
开发者ID:martinw0102,项目名称:ProjetSyst,代码行数:7,代码来源:insert_renderer.php

示例8: searchresultAction

 public function searchresultAction()
 {
     $page = $this->request->queryString("page");
     if (empty($page)) {
         $page = "1";
     }
     $key = $this->request->getParam('txtKey');
     if (!isset($key)) {
         $key = '';
     } else {
         $key = trim($key);
     }
     $totalRecord = $this->model->get('product')->getTotalResult($key);
     $this->view->data['page'] = $page;
     $this->view->data['totalRecord'] = $totalRecord;
     $this->view->data['pageSize'] = 10;
     $this->view->data['products'] = $this->model->get('product')->getSearchResults($key, $page, $this->view->data['pageSize']);
     $grid = new Grid($this->view->data['products']);
     $grid->setModule('admin');
     $grid->setController('product');
     $grid->setTotalRecord($totalRecord);
     $grid->setPageSize($this->view->data['pageSize']);
     $grid->setPage($page);
     $grid->addColumn(array('header' => 'Tiêu đề bài viết', 'align' => 'left', 'width' => '', 'index' => 'title'));
     $grid->addColumn(array('header' => 'URL key', 'align' => 'left', 'width' => '', 'index' => 'url_key'));
     $grid->addColumn(array('header' => 'Xuất bản', 'align' => 'center', 'width' => '140', 'index' => 'public_time'));
     $grid->addColumn(array('header' => 'Thứ tự', 'align' => 'center', 'width' => '60', 'index' => 'priority'));
     $this->view->data['grid'] = $grid;
     $this->view->show('search');
 }
开发者ID:phithienthan,项目名称:vnitc,代码行数:30,代码来源:productController.php

示例9: SetGridSimpleErrorMessage

 protected function SetGridSimpleErrorMessage($message, $decodeMessage = true)
 {
     if ($decodeMessage) {
         $this->grid->SetErrorMessage($this->GetPage()->RenderText($message));
     } else {
         $this->grid->SetErrorMessage($message);
     }
 }
开发者ID:outsourcinggithub,项目名称:outsourcing,代码行数:8,代码来源:grid_state.php

示例10: __invoke

 public function __invoke()
 {
     $grid = new Grid();
     $santa = new Santa($grid);
     $elf = new Elf($santa);
     $input = file_get_contents(__DIR__ . '/../../input/Day3/input.txt');
     $elf->readDirections($input);
     $visitedHouses = $grid->getVisitedHouses();
     echo "Total visited houses: " . $visitedHouses . "\n\n";
 }
开发者ID:dstockto,项目名称:AdventOfCode2015,代码行数:10,代码来源:Puzzle1.php

示例11: index

 function index()
 {
     if (!isAuth(203)) {
         return;
     }
     $this->view->clientsJS("personnel" . DS . "personnel");
     $data = $this->Fonction->selectAll();
     $fonctions = new Combobox($data, "fonction", "IDFONCTION", "LIBELLE");
     $fonctions->first = "Toutes";
     $fonctions->onchange = "showPersonnelByFunction();";
     $data = $this->Personnel->selectAll();
     $personnels = new Grid($data, 0);
     $personnels->addcolonne(0, "IDPERSONNEL", "IDPERSONNEL", false);
     $personnels->addcolonne(1, "Civ", "CIVILITE");
     $personnels->addcolonne(2, "Matricule", "MATRICULE");
     $personnels->addcolonne(3, "Nom", "NOM");
     $personnels->addcolonne(4, "Prénom", "PRENOM");
     $personnels->addcolonne(5, "Fonction", "LIBELLE");
     $personnels->addcolonne(6, "Portable", "PORTABLE");
     $personnels->droitdelete = 507;
     $personnels->droitedit = 513;
     $personnels->dataTable = "tablePersonnel";
     $personnels->actionbutton = true;
     $personnels->deletebutton = true;
     $personnels->editbutton = true;
     $total = count($data);
     $this->Assign("content", (new View())->output(["fonctions" => $fonctions->view("50%"), "personnels" => $personnels->display(), "total" => $total], false));
 }
开发者ID:ktla,项目名称:locan-2,代码行数:28,代码来源:personnelController.php

示例12: index

 public function index()
 {
     if (!isAuth(211)) {
         return;
     }
     $this->view->clientsJS("frais" . DS . "index");
     $view = new View();
     $frais = $this->Frais->getFrais($this->session->anneeacademique);
     $grid = new Grid($frais, 0);
     $grid->addcolonne(0, "IDFRAIS", "IDFRAIS", false);
     $grid->addcolonne(1, "Classe", "LIBELLE");
     $grid->addcolonne(2, "Niveau", "NIVEAUHTML");
     $grid->addcolonne(3, "Description du frais", "DESCRIPTION");
     $grid->addcolonne(4, "Montant", "MONTANT");
     $grid->addcolonne(5, "Echéances", "ECHEANCES");
     $grid->dataTable = "fraisTable";
     $grid->actionbutton = true;
     $grid->deletebutton = true;
     $grid->droitdelete = 510;
     $grid->droitedit = 511;
     $grid->setColDate(5);
     $view->Assign("frais", $grid->display());
     $content = $view->Render("frais" . DS . "index", false);
     $this->Assign("content", $content);
 }
开发者ID:jpainam,项目名称:cosba,代码行数:25,代码来源:fraisController.php

示例13: createResource

 /**
  *
  * Create resource for json data answer
  * @param Data\IGridRepository $repository
  * @param Conditions $conditions
  * @param Grid $grid
  *
  * @return stdClass
  */
 private static function createResource($repository, $conditions, $grid)
 {
     $resource = new \stdClass();
     if ($repositoryData = $repository->getData($conditions)) {
         $resource->rows = self::adaptRepositoryData($repositoryData, $grid->getSortName(), $grid->getColumnCollection());
     }
     $resource->records = (string) $repository->countDataRows($conditions);
     $resource->page = (string) $conditions->page;
     //Total pages
     $resource->total = $resource->records > 0 ? ceil($resource->records / $conditions->rowsLimit) : 0;
     return $resource;
 }
开发者ID:djuki,项目名称:jqgrider,代码行数:21,代码来源:RepositoryResult.php

示例14: fromArray

 /**
  * Create a new grid from a 9*9 array of values
  *
  * @param array $rows
  *
  * @return Grid
  */
 public static function fromArray(array $rows)
 {
     $grid = new Grid();
     $grid->validateRows($rows);
     foreach ($rows as $y => $row) {
         $grid->validateRow($y, $row);
         foreach ($row as $x => $value) {
             $grid->validateCellDoesntExist($grid, $x, $y);
             $grid->addCell($x, $y, $value);
         }
     }
     return $grid;
 }
开发者ID:chenruixuan,项目名称:Sudoku,代码行数:20,代码来源:Grid.php

示例15: __invoke

 public function __invoke()
 {
     $light = new Light();
     $grid = new Grid(1000, 1000, $light);
     $parser = new InstructionParser();
     $input = file(__DIR__ . '/../../input/Day6/input.txt');
     foreach ($input as $line) {
         // Parse instruction, pass to grid
         $commands = $parser->parseLine($line);
         $grid->doOperation($commands[0], $commands[1], $commands[2], $commands[3], $commands[4]);
     }
     $numberOfLights = $grid->getTotalBrightness();
     echo "Total brightness: " . $numberOfLights . "\n\n";
 }
开发者ID:dstockto,项目名称:AdventOfCode2015,代码行数:14,代码来源:Puzzle2.php


注:本文中的Grid类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。