本文整理汇总了PHP中Grid类的典型用法代码示例。如果您正苦于以下问题:PHP Grid类的具体用法?PHP Grid怎么用?PHP Grid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Grid类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: parse
public function parse($ex_file, $s_file)
{
global $VERSION;
$css = file_get_contents($s_file);
$ex = parse_ini_file($ex_file, TRUE);
print "<style>";
print "\n/* Generated by exCSS v." . $VERSION . "*/\n";
if (isset($ex['ExtendedCSS'])) {
while ($cur = current($ex['ExtendedCSS'])) {
$var = key($ex['ExtendedCSS']);
$var_value = $ex['ExtendedCSS'][$var];
$css = str_replace("\$" . $var, $var_value, $css);
next($ex['ExtendedCSS']);
}
}
if (isset($ex['Grid'])) {
$parts = $ex['Grid']['grid-parts'];
// how many parts like 1 or 4
$height = $ex['Grid']['grid-height'];
// height like 50% or 100%
$props = $ex['Grid']['grid-props'];
// proportions like 1-2-1 or 2-3-2
$grid = new Grid($parts, $height, $props);
}
foreach (array_keys($ex) as $x) {
if ($x == 'Grid' || $x == 'ExtendedCSS') {
continue;
}
// now there can only be things like .div1 or #div2 or div
if (isset($ex["Grid"])) {
if (isset($ex[$x]['grid-position'])) {
$element_data = $grid->generateCSS($x, $ex[$x]['grid-position']);
print $element_data;
}
}
if (isset($ex[$x]["animation"])) {
$object = $x;
$anim_name = $ex[$x]["animation"];
$par = explode(';', $ex[$x]['animation-parameter']);
$parameter = new Parameter();
foreach ($par as $i) {
$temp = explode(':', $i);
$parameter->add($temp[0], $temp[1]);
}
$anim = new Animation($anim_name, $object, $parameter);
}
}
print "\n" . $css . "\n\n.container{\n\n\tdisplay: table;\n\twidth:100%;\n\theight:100%;\n\n}\n\n</style>\n";
}
开发者ID:exCSS,项目名称:Core,代码行数:49,代码来源:parser.php
示例17: helper_invoices_grid_build
function helper_invoices_grid_build(Grid $grid)
{
$grid->add_button('Заказы', set_url('*/orders'));
$grid->add_column(array('index' => 'invoices_number', 'searchtable' => 'A', 'type' => 'text', 'tdwidth' => '14%', 'sortable' => true, 'filter' => true), 'Номер инвойса');
$grid->add_column(array('index' => 'orders_number', 'searchtable' => 'B', 'type' => 'text', 'tdwidth' => '13%', 'sortable' => true, 'filter' => true), 'Номер заказа');
$grid->add_column(array('index' => 'total', 'type' => 'text'), 'Сумма');
$grid->add_column(array('index' => 'create_date', 'type' => 'date', 'tdwidth' => '11%', 'sortable' => true, 'filter' => true), 'Создан');
$grid->add_column(array('index' => 'update_date', 'type' => 'date', 'tdwidth' => '11%', 'sortable' => true, 'filter' => true), 'Обновлен');
$grid->add_column(array('index' => 'invoices_status', 'type' => 'select', 'options' => array('' => '') + Minvoices::get_invoice_state_collection(), 'tdwidth' => '12%', '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('*/*/view_invoice/inv_id/$1'), 'href_values' => array('ID'), 'options' => array('class' => 'icon_view', 'title' => 'Просмотр')))), 'Actions');
}
开发者ID:vitalik199415,项目名称:ozar,代码行数:11,代码来源:invoices_helper.php
示例18: output
public function output(Grid $grid)
{
$this->history = $grid->getHistory();
$this->grid = $grid;
$output = '<table>';
$size = $grid->getSize();
for ($y = 1; $y <= $size; $y++) {
$output .= '<tr>';
for ($x = 1; $x <= $size; $x++) {
$output .= $this->getPlayableColumn($x, $y);
}
$output .= '</tr>';
}
return $output;
}
开发者ID:noeldavies,项目名称:battleships,代码行数:15,代码来源:GridOutputTable.php
示例19: helper_wh_shippings_grid_build
function helper_wh_shippings_grid_build(Grid $grid)
{
$CI =& get_instance();
$CI->load->model('warehouse/mwarehouses');
$wh_array = $CI->mwarehouses->get_wh_to_select();
$grid->add_column(array('index' => 'wh_shipping_number', 'type' => 'text', 'filter' => true, 'tdwidth' => '10%'), 'Номер');
$grid->add_column(array('index' => 'wh_sale_number', 'type' => 'text', 'searchtable' => 'B', 'tdwidth' => '10%', 'filter' => true), 'Номер продажи');
$grid->add_column(array('index' => 'total_qty', 'type' => 'text', 'tdwidth' => '7%'), 'К-во');
$grid->add_column(array('index' => 'total', 'type' => 'text'), 'Сумма');
$grid->add_column(array('index' => 'wh_alias', 'type' => 'select', 'searchtable' => 'C', 'searchname' => 'alias', 'options' => array('' => '') + $wh_array, 'filter' => true, 'tdwidth' => '10%'), 'Склад');
$grid->add_column(array('index' => 'wh_shipping_state', 'type' => 'text', 'tdwidth' => '10%'), 'Статус отправки');
$grid->add_column(array('index' => 'create_date', 'searchtable' => 'A', 'type' => 'date', 'tdwidth' => '12%', 'filter' => true), 'Дата создания');
$grid->add_column(array('index' => 'update_date', 'searchtable' => 'A', 'type' => 'date', 'tdwidth' => '12%', 'filter' => true), 'Дата обновления');
$grid->add_column(array('index' => 'action', 'type' => 'action', 'tdwidth' => '10%', 'option_string' => 'align="center"', 'actions' => array()), 'Действия');
}
开发者ID:vitalik199415,项目名称:ozar,代码行数:15,代码来源:warehouses_shippings_helper.php
示例20: gridToHTML
public function gridToHTML(Grid $grid, CartesianRegion $region)
{
$tile_size = $this->computeTileSize($region->getWidth(), $region->getHeight());
$output = '';
$gridWidth = $region->getWidth() * $this->tile_size;
$gridHeight = $region->getHeight() * $this->tile_size;
$output .= '<div id="box" style="width: ' . $gridWidth . 'px; height:' . $gridHeight . 'px;">';
foreach (new RegionIterator($region) as $coordinates) {
$tile = $grid->getTile($coordinates);
$screenCoords = $this->coordsToScreen($coordinates, $region);
$output .= $this->tileToHTML($tile, $screenCoords, $coordinates);
}
$output .= '</div>';
return $output;
}
开发者ID:elaor,项目名称:php-playground,代码行数:15,代码来源:CartesianGridView.php
注:本文中的Grid类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论