本文整理汇总了PHP中Column::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::__construct方法的具体用法?PHP Column::__construct怎么用?PHP Column::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Column
的用法示例。
在下文中一共展示了Column::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($name, $label, $url, $options = array())
{
$options['formatter'] = array($this, 'formatLink');
$this->url = $url;
$this->idProperty = $options['idProperty'] ?: 'id';
parent::__construct($name, $label, $options);
}
示例2: __construct
/**
* @param Grido\Grid $grid
* @param string $name
* @param string $label
* @param string $dateFormat
*/
public function __construct($grid, $name, $label, $dateFormat = NULL)
{
parent::__construct($grid, $name, $label);
if ($dateFormat !== NULL) {
$this->dateFormat = $dateFormat;
}
}
示例3: __construct
/**
*
* @param \Database\Resource $resource
* @param string $name
* @param string $alias
* @param boolean $check_existance Sends boolean argument to Column constructor
*/
public function __construct(\Database\Resource $resource, $name, $alias = null, $check_existance = null)
{
$check_existance = empty($check_existance) ? DATABASE_CHECK_COLUMNS : $check_existance;
parent::__construct($resource, $name, $check_existance);
if ($alias) {
$this->setAlias($alias);
}
}
示例4: __construct
public function __construct($columnName, $maximumLength, $defaultValue = "")
{
parent::__construct($columnName, $defaultValue);
if (!is_numeric($maximumLength)) {
throw new \InvalidArgumentException("maximumLength must be numeric");
}
$this->maximumLength = $maximumLength;
}
示例5: __construct
public function __construct($name, $columnHeader, $params = array())
{
parent::__construct($name, $columnHeader, $params);
if (isset($params['sortField']) && !is_null($params['sortField'])) {
$this->sortField = $params['sortField'];
} else {
$this->sortField = lcfirst($this->name);
}
}
示例6: __construct
public function __construct($idProperty = 'id')
{
parent::__construct('_checkbox', '<input type="checkbox" class="check-all" name="check-all"/>', array('required' => true, 'sortable' => false, 'searchable' => false, 'formatter' => function ($record, $col) use($idProperty) {
// If record is an object, try to call $record->getId(), then $record->id
if (is_object($record)) {
$func = $this->camelize('get_' . $idProperty);
if (is_callable(array($record, $func))) {
$id = call_user_func(array($record, $func));
} else {
$id = $record->{$idProperty};
}
} else {
// Else record is an array, simply access the wanted property
$id = $record[$idProperty];
}
$id = htmlspecialchars($id);
return '<input type="checkbox" class="check-row" name="check[' . $id . ']"/>';
}));
}
示例7: __construct
/**
* @param string $name
* @param string $field
* @param string $entityField
* @param array $options
*/
public function __construct($name, $field, $entityField, array $options = [])
{
$this->entityField = $entityField;
$pos = strpos($field, '.');
if (false !== $pos) {
$fields = $field;
while (false !== $pos) {
$sub = substr($fields, 0, $pos);
$this->prefixes[] = EntityColumn::createEntityPrefix($sub);
$fields = substr($fields, $pos + 1);
$pos = strpos($fields, '.');
if (false === $pos && 0 < strlen($fields)) {
$pos = strlen($fields);
}
}
} else {
$this->prefixes[] = self::createEntityPrefix($field);
}
parent::__construct($name, $field, $options);
}
示例8: __construct
public function __construct($actions, $idProperty = 'id')
{
global $l;
parent::__construct('_actions', $l->g(1381), array('required' => true, 'sortable' => false, 'searchable' => false, 'formatter' => function ($record, $col) use($actions, $idProperty) {
// If record is an object, try to call $record->getId(), then $record->id
if (is_object($record)) {
$func = $this->camelize('get_' . $idProperty);
if (is_callable(array($record, $func))) {
$id = call_user_func(array($record, $func));
} else {
$id = $record->{$idProperty};
}
} else {
// Else record is an array, simply access the wanted property
$id = $record[$idProperty];
}
$id = htmlspecialchars($id);
$actionHtml = '';
foreach ($actions as $url => $class) {
$actionHtml .= '<a href="' . $url . $id . '" class="row-action">' . '<span class="' . $class . '"></span>' . '</a>';
}
return $actionHtml;
}));
}
示例9: __construct
/**
* @param Grido\Grid $grid
* @param string $name
* @param string $label
* @param int $decimals number of decimal points
* @param string $decPoint separator for the decimal point
* @param string $thousandsSep thousands separator
*/
public function __construct($grid, $name, $label, $decimals = NULL, $decPoint = NULL, $thousandsSep = NULL)
{
parent::__construct($grid, $name, $label);
$this->setNumberFormat($decimals, $decPoint, $thousandsSep);
}
示例10: __construct
public function __construct($column, $name, $format = 'j.n.Y')
{
parent::__construct($column, $name);
$this->format = $format;
}
示例11: __construct
public function __construct($name, $label, $format = 'd/m/Y')
{
parent::__construct($name, $label);
$this->format = $format;
}
示例12: __construct
public function __construct($name, $flags, $extra = array())
{
parent::__construct($name, $flags, $extra);
}
示例13: __construct
public function __construct()
{
parent::__construct(array('id' => self::ID, 'title' => '', 'size' => 15, 'filterable' => true, 'sortable' => false, 'source' => false, 'align' => 'center'));
}
示例14: __construct
public function __construct($column, $name, $languageId)
{
parent::__construct($column, $name);
$this->languageId = $languageId;
}
示例15: __construct
public function __construct($column, $name, $table)
{
parent::__construct($column, $name);
$this->table = $table;
$this->setOrdering(false);
}