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


PHP K2HelperHTML::gender方法代码示例

本文整理汇总了PHP中K2HelperHTML::gender方法的典型用法代码示例。如果您正苦于以下问题:PHP K2HelperHTML::gender方法的具体用法?PHP K2HelperHTML::gender怎么用?PHP K2HelperHTML::gender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在K2HelperHTML的用法示例。


在下文中一共展示了K2HelperHTML::gender方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setFormFields

 /**
  * Hook for children views to allow them attach fields to the form object.
  * Children views usually should override this method.
  *
  * @return void
  */
 protected function setFormFields(&$_form, $row)
 {
     $language = JFactory::getLanguage();
     $language->load('', JPATH_ADMINISTRATOR);
     $language->load('com_users', JPATH_ADMINISTRATOR);
     // Import JForm
     jimport('joomla.form.form');
     // Determine form name and path
     $formName = 'K2' . ucfirst($this->getName()) . 'Form';
     $formPath = JPATH_ADMINISTRATOR . '/components/com_users/models/forms/user.xml';
     // Convert JRegistry instances to plain object so JForm can bind them
     if ($row->id) {
         $row->params = $row->params->toObject();
     }
     // Get the form instance
     $form = JForm::getInstance($formName, $formPath);
     // Bind values
     $form->bind($row);
     $form->setValue('password', null);
     $form->setValue('password2', null);
     // Attach the JForm fields to the form
     foreach ($form->getFieldsets() as $fieldset) {
         $array = array();
         foreach ($form->getFieldset($fieldset->name) as $field) {
             $tmp = new stdClass();
             $tmp->label = $field->label;
             $tmp->input = $field->input;
             $array[$field->name] = $tmp;
         }
         $name = $fieldset->name;
         $_form->{$name} = $array;
     }
     JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/models');
     $model = JModelLegacy::getInstance('User', 'UsersModel');
     if ($row->id) {
         $assignedGroups = $model->getAssignedGroups($row->id);
     } else {
         $assignedGroups = null;
     }
     $_form->groups = JHtml::_('access.usergroups', 'groups', $assignedGroups, true);
     require_once JPATH_ADMINISTRATOR . '/components/com_k2/helpers/html.php';
     $_form->gender = K2HelperHTML::gender('gender', $row->gender);
     require_once JPATH_ADMINISTRATOR . '/components/com_k2/helpers/extrafields.php';
     $_form->extraFields = K2HelperExtraFields::getUserExtraFieldsGroups($row->extra_fields);
     require_once JPATH_ADMINISTRATOR . '/components/com_k2/classes/editor.php';
     $config = JFactory::getConfig();
     $editor = K2Editor::getInstance($config->get('editor'));
     $_form->description = $editor->display('description', $row->description, '100%', '300', '40', '5');
 }
开发者ID:Naldo100,项目名称:k2-v3-dev-build,代码行数:55,代码来源:view.json.php


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