本文整理汇总了PHP中ORM::labels方法的典型用法代码示例。如果您正苦于以下问题:PHP ORM::labels方法的具体用法?PHP ORM::labels怎么用?PHP ORM::labels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ORM
的用法示例。
在下文中一共展示了ORM::labels方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_label
/**
* Get the label for a given column if it is set
*
* @author tspencer
* @param string $col Column name to get the field from
* @return string Label for this column if it is set
*****************************************************/
public function get_label($col)
{
if (!$this->_orm) {
throw new Missing_ORM_Exception("There is no ORM object linked to this Entity instance");
}
$labels = $this->_orm->labels();
return isset($labels[$col]) ? $labels[$col] : '';
}
示例2: __construct
public function __construct(ORM $orm, array $columns = array(), $options = array())
{
$this->_options = $options;
$this->set_name($orm->object_name());
foreach ($columns as $name => $column) {
if (!is_array($column)) {
$column = array('type' => $column);
}
$column_cfg = array('name' => $name, 'header' => Arr::get($orm->labels(), $name), 'params' => Arr::get($column, 'params', array()));
$column = Arr::merge($column_cfg, (array) $column);
$column = Grid_Column::factory($column);
$this[$name] = $column;
}
$this->_orm = $orm;
}
示例3: __construct
protected function __construct(ORM $object, array $fields = array())
{
$this->_object = $object;
$this->set_name($object->object_name());
$hash = '';
foreach ($fields as $name => $field) {
if (!is_array($field)) {
$field = array('type' => $field);
}
$field_cfg = array('name' => $name, 'label' => Arr::get($object->labels(), $name), 'value' => $object[$name]);
$field = Arr::merge($field_cfg, (array) $field);
$field = Form_Field::factory($field);
$field->set_object($object);
$this[$name] = $field;
$hash .= $field->hash();
}
$this->_hash = md5($hash);
}
示例4: labels
public function labels()
{
if (!$this->_z_inited) {
return parent::labels();
}
return $this->_z_labels;
}