本文整理汇总了PHP中dmString::tableize方法的典型用法代码示例。如果您正苦于以下问题:PHP dmString::tableize方法的具体用法?PHP dmString::tableize怎么用?PHP dmString::tableize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dmString
的用法示例。
在下文中一共展示了dmString::tableize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executePaginateRelation
/**
* Called via ajax by edit forms which have many-to-many widgets
*
* @param dmWebRequest $request
*/
public function executePaginateRelation(dmWebRequest $request)
{
$field = dmString::lcfirst($request->getParameter('field'));
$startPage = $request->getParameter('page');
$maxPerPage = $request->getParameter('maxPerPage');
$this->getUser()->setAttribute($this->getModuleName() . '.' . $field . '.max_per_page', $maxPerPage, 'admin_module');
$search = $request->getParameter('search', false);
$model = dmString::tableize($this->getDmModule()->getModel());
$this->{$model} = $this->getObject();
$this->nearRecords = array();
$this->form = $this->configuration->getForm($this->{$model}, array('widgets' => array($field)));
$this->field = $this->form->getWidget($field);
$this->search = $search;
$query = $this->paginationCreateRelationQuery($field, $request->getParameter('pk'), $search);
$pager = $this->field->getPager();
$pager->setQuery($query);
$pager->setMaxPerPage($maxPerPage);
$pager->setPage($startPage);
$this->name = $field;
$fields = array_diff(array_keys($this->form->getWidgetSchema()->getFields()), array($field));
foreach ($fields as $field) {
unset($this->form[$field]);
}
$this->configuration->setFormDisplay(array($this->name));
$this->setTemplate('edit');
//$this->setLayout(false);
}
示例2: renderNewLink
protected function renderNewLink()
{
$link = $this->helper->link('@' . $this->foreignModule->getUnderscore() . '?action=new')->text($this->i18n->__('New'))->set('.s16.s16_add_little');
if ($this->relation instanceof Doctrine_Relation_ForeignKey) {
$link->param('defaults[' . $this->relation->getForeign() . ']', $this->record->get('id'));
} elseif ($this->relation instanceof Doctrine_Relation_Association) {
$opposite = $this->relation['localTable']->getAssociationOppositeRelation($this->relation);
if ($opposite) {
$link->param('defaults[' . dmString::tableize($opposite->getAlias()) . '_list][]', $this->record->get('id'));
}
}
return $link->render();
}
示例3: executePaginateRelation
/**
* Called via ajax by edit forms which have many-to-many widgets
*
* @param dmWebRequest $request
*/
public function executePaginateRelation(dmWebRequest $request)
{
$field = lcfirst($request->getParameter('field'));
$relation = dmString::camelize(substr($field, 0, strlen($field) - 5));
//remove _list @todo make it given by $request, using .metadata() and writting it within template
$table = $this->getDmModule()->getTable();
if ($table->hasRelation($relation)) {
$relation = $table->getRelation($relation);
} elseif ($table->hasRelation($field)) {
$relation = $table->getRelation($field);
} elseif ($table->hasRelation($relation = dmString::camelize($field))) {
$relation = $table->getRelation($relation);
}
$startPage = $request->getParameter('page');
$maxPerPage = $request->getParameter('maxPerPage');
$this->getUser()->setAttribute($this->getModuleName() . '.' . $field . '.max_per_page', $maxPerPage, 'admin_module');
$search = $request->getParameter('search', false);
$model = dmString::tableize($this->getDmModule()->getModel());
$this->{$model} = $this->getObject();
$this->nearRecords = array();
$this->form = $this->configuration->getForm($this->{$model});
$this->field = $this->form->getWidget($field);
/**
* @var dmDoctrinePager
*/
$pager = $this->field->getPager();
$pager->setMaxPerPage($maxPerPage);
$pager->setPage($startPage);
$query = $this->createPaginateRelationQuery($field, $relation, $search);
$pager->setQuery($query);
$this->name = $field;
$fields = array_diff(array_keys($this->form->getWidgetSchema()->getFields()), array($field));
foreach ($fields as $field) {
unset($this->form[$field]);
}
$this->configuration->setFormDisplay(array($this->name));
$this->setTemplate('edit');
$this->setLayout(false);
}