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


PHP EventManager::getAllTypes方法代码示例

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


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

示例1: EventManager

 function __construct($controller, $name, $use_actions = true)
 {
     $event_manager = new EventManager($this->repository, new EventRegistrationRequestFactory(), null, new SapphireEventPublishingService(), new EventValidatorFactory(), SapphireTransactionManager::getInstance());
     $fields = new FieldList();
     //point of contact
     $fields->push(new TextField('point_of_contact_name', 'Name'));
     $fields->push(new EmailField('point_of_contact_email', 'Email'));
     //main info
     $fields->push(new TextField('title', 'Title'));
     $fields->push(new TextField('url', 'Url'));
     $types = $event_manager->getAllTypes();
     foreach ($types as $type) {
         $options[$type] = $type;
     }
     $categoryField = new DropdownField('category', 'Category', $options);
     $categoryField->setEmptyString('-- select a category --');
     $fields->push($categoryField);
     //location
     $fields->push(new TextField('city', 'City'));
     $fields->push(new TextField('state', 'State'));
     $countryField = new CountryDropdownField('country', 'Country');
     $countryField->setEmptyString('-- select a country --');
     $fields->push($countryField);
     //duration
     $fields->push($start_date = new TextField('start_date', 'Start Date'));
     $fields->push($end_date = new TextField('end_date', 'End Date'));
     $start_date->addExtraClass('date');
     $end_date->addExtraClass('date');
     // Guard against automated spam registrations by optionally adding a field
     // that is supposed to stay blank (and is hidden from most humans).
     // The label and field name are intentionally common ("username"),
     // as most spam bots won't resist filling it out. The actual username field
     // on the forum is called "Nickname".
     $fields->push(new TextField('user_name', 'UserName'));
     // Create action
     $actions = new FieldList();
     if ($use_actions) {
         $actions->push(new FormAction('saveEventRegistrationRequest', 'Save'));
     }
     // Create validators
     $validator = new ConditionalAndValidationRule(array(new HtmlPurifierRequiredValidator('title', 'city'), new RequiredFields('point_of_contact_name', 'point_of_contact_email', 'start_date', 'end_date', 'country')));
     parent::__construct($controller, $name, $fields, $actions, $validator);
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:43,代码来源:EventRegistrationRequestForm.php


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