本文整理汇总了PHP中Grid::column方法的典型用法代码示例。如果您正苦于以下问题:PHP Grid::column方法的具体用法?PHP Grid::column怎么用?PHP Grid::column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Grid
的用法示例。
在下文中一共展示了Grid::column方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDataDefinition
/**
* Test data definition method
*/
function testDataDefinition()
{
$dataset1 = array('object1' => array('name' => 'Bob'), 'object2' => array('name' => 'Ben'));
$dataset2 = array('object3' => array('name' => 'Bud'));
$SUT = new Grid();
$SUT->column()->field('name')->title('Name');
$SUT->data($dataset1);
$grid = $SUT->render();
$this->assertRegExp('/Bob/', $grid);
$this->assertNotRegExp('/Bud/', $grid);
$SUT->data($dataset2);
$grid = $SUT->__tostring();
$this->assertRegExp('/Ben/', $grid);
$this->assertRegExp('/Bud/', $grid);
}
示例2: __
<h2><?php
echo __(':dir directory', array(':dir' => $folder));
?>
<small>
<?php
echo HTML::anchor(Route::get('admin/resource')->uri(array('action' => 'create', 'path' => $folder->parent . '/' . $folder->name)), 'Create Folder');
?>
<?php
echo HTML::anchor(Route::get('admin/resource')->uri(array('action' => 'upload', 'path' => $folder->parent . '/' . $folder->name)), 'Upload File');
?>
</small>
</h2>
<?php
// Create directory listing
$grid = new Grid();
$grid->column('action')->field('path')->title('File/Folder Name')->text('{name}')->route(Route::get('admin/resource'))->params(array('action' => 'read'))->param('path');
$grid->column()->field('size')->title('Size');
$grid->column()->field('date')->title('Date Modified');
$grid->column('action')->field('path')->title('Actions')->text('Delete')->class('delete')->route(Route::get('admin/resource'))->params(array('action' => 'delete'))->param('path');
$grid->data($folder->folders);
$grid->data($folder->files);
echo $grid->render();
示例3: __
<h2><?php
echo __('":title" History', array(':title' => $page->title));
?>
<small><?php
echo HTML::anchor(Request::$current->uri(array('action' => 'list')), 'back');
?>
</small>
</h2>
<?php
echo form::open();
echo '<p class="submit">';
echo Form::submit('submit', __('View Diff'));
echo '</p>';
// Create revision list
$grid = new Grid();
$grid->column('radio')->field('version')->title('Version 1')->name('ver1');
$grid->column('radio')->field('version')->title('Version 2')->name('ver2');
$grid->column()->field('version')->title('Revision');
$grid->column()->field('editor')->title('Editor');
$grid->column('date')->field('date')->title('Date');
$grid->column()->field('comments')->title('Comments');
$grid->data($revisions);
echo $grid;
echo form::close();
示例4: __
<h2><?php
echo __('Users List');
?>
</h2>
<?php
if (count($users) == 0) {
?>
<p>
There are no users at this time
(<?php
echo HTML::anchor(Route::$current->uri(array('action' => 'new')), 'create one');
?>
).
</p>
<?php
} else {
// Create user list
$grid = new Grid();
$grid->column()->field('id')->title('ID');
$grid->column('action')->title('Username')->text('{username}')->route(Route::get('admin'))->params(array('controller' => 'users', 'action' => 'view'));
$grid->column()->field('role')->title('Role');
$grid->column()->field('email')->title('Email');
$grid->column('action')->title('Actions')->text('Edit')->class('edit')->route(Route::get('admin'))->params(array('controller' => 'users', 'action' => 'edit'));
$grid->column('action')->title('')->text('Delete')->class('delete')->route(Route::get('admin'))->params(array('controller' => 'users', 'action' => 'delete'));
$grid->data($users);
echo $grid;
}
示例5: __
<h2><?php
echo __('Tag List');
?>
</h2>
<?php
if (count($tags) == 0) {
?>
<p>
There are no tags at this time
(<?php
echo HTML::anchor($request->uri(array('action' => 'new')), 'create one');
?>
).
</p>
<?php
} else {
// Create tag list
$grid = new Grid();
$grid->column()->field('id')->title('ID');
$grid->column()->field('name')->title('Name');
$grid->column('action')->title('Actions')->text('Edit')->class('edit')->route($request)->params(array('action' => 'edit'));
$grid->column('action')->title('')->text('Delete')->class('delete')->route($request)->params(array('action' => 'delete'));
$grid->data($tags);
echo $grid->render();
}
示例6: Grid
<h2><?php
echo $legend;
?>
</h2>
<?php
if (count($articles) == 0) {
?>
<p>
There are no posts as this time
(<?php
echo HTML::anchor(Route::$current->uri(array('action' => 'new')), 'create one');
?>
).
</p>
<?php
} else {
// Create article list
$grid = new Grid();
$grid->column()->field('id')->title('ID');
$grid->column()->field('title')->title('Title');
$grid->column()->field('state')->title('State');
$grid->column('action')->title('Actions')->text('Edit')->class('edit')->route($request)->params(array('action' => 'edit'));
$grid->column('action')->title('')->text('History')->class('history')->route($request)->params(array('action' => 'history'));
$grid->data($articles);
echo $pagination;
echo $grid->render();
echo $pagination;
}
示例7: __
<h2><?php
echo __('Page List');
?>
</h2>
<?php
if (count($pages) == 0) {
?>
<p>
There are no pages at this time
(<?php
echo HTML::anchor(Route::$current->uri(array('action' => 'new')), 'create one');
?>
).
</p>
<?php
} else {
// Create page list
$grid = new Grid();
$grid->column()->field('id')->title('ID');
$grid->column()->field('title')->title('Title');
$grid->column()->field('version')->title('Ver');
$grid->column('action')->title('Actions')->text('Edit')->class('edit')->route(Route::get('admin/cms'))->params(array('action' => 'edit'));
$grid->column('action')->title('')->text('History')->class('history')->route(Route::get('admin/cms'))->params(array('action' => 'history'));
$grid->data($pages);
echo $grid;
}