当前位置: 首页>>代码示例>>PHP>>正文


PHP dmString::tableize方法代码示例

本文整理汇总了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);
 }
开发者ID:runopencode,项目名称:diem-extended,代码行数:32,代码来源:dmAdminBaseGeneratedModuleActions.php

示例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();
 }
开发者ID:rafix,项目名称:diem,代码行数:13,代码来源:dmAdminRelatedRecordsView.php

示例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);
 }
开发者ID:rafix,项目名称:diem,代码行数:44,代码来源:dmAdminBaseGeneratedModuleActions.php


注:本文中的dmString::tableize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。