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


PHP Task::fill方法代码示例

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


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

示例1: createtask_POST

function createtask_POST(Web &$w)
{
    $w->Task->navigation($w, "Create Task");
    // unserialise input from step I and store in array: arr_req
    $arr_req = unserialize($w->request('formone'));
    // set relevant dt variables with: Today.
    $arr_req['dt_assigned'] = Date('c');
    $arr_req['dt_first_assigned'] = Date('c');
    // insert Task into database
    $task = new Task($w);
    $task->fill($arr_req);
    $task->insert();
    // if insert is successful, store additional fields as task data
    // we do not want to store data from step I, the task_id (as a key=>value pair) nor the FLOW_SID
    if ($task->id) {
        foreach ($_POST as $name => $value) {
            if ($name != "formone" && $name != "FLOW_SID" && $name != "task_id" && $name !== CSRF::getTokenID()) {
                $tdata = new TaskData($w);
                $arr = array("task_id" => $task->id, "key" => $name, "value" => $value);
                $tdata->fill($arr);
                $tdata->insert();
                unset($arr);
            }
        }
        // return to task dashboard
        $w->msg("Task " . $task->title . " added", "/task/viewtask/" . $task->id);
    } else {
        // if task insert was unsuccessful, say as much
        $w->msg("The Task could not be created. Please inform the IT Group", "/task/index/");
    }
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:31,代码来源:createtask.php

示例2: update

 /**
  * Update the specified resource in storage.
  * PUT /tasks/{id}
  *
  * @param  Project $project, Task $task
  * @return Response
  */
 public function update(Project $project, Task $task)
 {
     $input = array_except(Input::all(), '_method');
     $task->fill($input);
     if ($task->updateUniques()) {
         return Redirect::route('projects.tasks.show', [$project->slug, $task->slug])->with('message', 'Task updated.');
     } else {
         return Redirect::route('projects.tasks.edit', [$project->slug, array_get($task->getOriginal(), 'slug')])->withInput()->withErrors($task->errors());
     }
 }
开发者ID:marciocamello,项目名称:laravel-ecommerce,代码行数:17,代码来源:TasksController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $task = new Task();
     $task->unguard();
     $task->fill(Input::only(['name', 'user_id', 'description', 'status']));
     $task->deadline = new DateTime(Input::get('deadline'));
     if ($task->validate()) {
         $task->save();
     } else {
         return View::make('tasks.edit', ['task' => $task])->withErrors($task->validator());
     }
     return Redirect::to(route('tasks.index'))->with('message', ['content' => 'Taak met succes aangemaakt!', 'class' => 'success']);
 }
开发者ID:y0sh1,项目名称:logboek,代码行数:18,代码来源:TasksController.php

示例4: Project

<?php

# new_task.php
# 1. logic
$project = new Project();
$project->load(['slug' => Route::param('slug')]);
if (Input::posted()) {
    $task = new Task();
    $task->fill(Input::all());
    $task->user_id = Auth::user_id();
    $task->project_id = $project->id;
    if (Input::get('name') != "" || Input::get('description') != "") {
        $task->save();
    }
}
URL::redirect('/' . $project->slug);
开发者ID:Wade-Nairn,项目名称:get-it-done-WE04,代码行数:16,代码来源:new_task.php


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