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


PHP Events::add方法代码示例

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


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

示例1: addAction

 /** Add an event
  * @access public
  * @return void
  * @todo geocoding and processing in view
  */
 public function addAction()
 {
     $form = new EventForm();
     $form->details->setLegend('Add a new event');
     $form->submit->setLabel('Save event');
     $this->view->form = $form;
     if ($this->_request->isPost() && $form->isValid($this->_request->getPost())) {
         $this->_events->add($form->getValues());
         $this->getFlash()->addMessage('New event created!');
         $this->redirect('/admin/events/');
     } else {
         $form->populate($this->_request->getPost());
     }
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:19,代码来源:EventsController.php

示例2: addAddsEventToList

 /**
  * @test
  */
 public function addAddsEventToList()
 {
     $event = $this->getMockBuilder(Event::class)->getMock();
     $instance = new Events();
     $instance->add($event);
     self::assertCount(1, $instance->getIterator());
 }
开发者ID:martyn82,项目名称:apha,代码行数:10,代码来源:EventsTest.php

示例3: Land

//Haal landen op
$landen = new Land();
$landen = $landen->get_all();
$events = new Events();
//Check of er POST waarde is
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    //Valideer post attr
    if ($_POST && isset($_POST['naam'], $_POST['omschrijving'], $_POST['datum'], $_POST['type'], $_POST['genre'], $_POST['plaatsnaam'], $_POST['land'])) {
        $naam = test_input($_POST['naam']);
        $omschrijving = test_input($_POST['omschrijving']);
        $datum = test_input($_POST['datum']);
        $type = test_input($_POST['type']);
        $genre = test_input($_POST['genre']);
        $plaatsnaam = test_input($_POST['plaatsnaam']);
        $land = test_input($_POST['land']);
        $event = $events->add($type, $genre, $land, $plaatsnaam, $naam, $omschrijving, $datum, $usr['id']);
        if ($event) {
            $event = $events->get($event);
            if ($event) {
                ?>
                <script>
                    $.notify("Evenement is succesvol aangemaakt!", "success");
                </script>
                <?php 
                header('HTTP/1.0 302 Found');
                header("Location: index.php?map=events&page=edit&id=" . $event['events_id']);
            } else {
                ?>
                <script>
                    $.notify("Evenement kon niet worden aangemaakt", "error");
                </script>
开发者ID:MHakvoort,项目名称:origin,代码行数:31,代码来源:add.php


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