本文整理汇总了PHP中Task::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::all方法的具体用法?PHP Task::all怎么用?PHP Task::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::all方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$tasks = $this->task->all();
//var_dump(getenv('DB_HOST'));
return View::make('tasks.index', compact('tasks'));
//return View::make('tasks.stuff');
}
示例2: index
public static function index()
{
self::check_logged_in();
$tasks = Task::all();
//Get all tasks from db
View::make('task/index.html', array('tasks' => $tasks));
}
示例3: index
public static function index()
{
// make-metodi renderöi app/views-kansiossa sijaitsevia tiedostoja
$tasks = Task::all(self::get_user_logged_in()->id);
$categories = Category::all(self::get_user_logged_in()->id);
View::make('dashboard.html', array('tasks' => $tasks, 'categories' => $categories, 'category' => 'all'));
}
示例4: tasks
public function tasks($project_id)
{
$organization = app('organization');
// Load tasks
$tasks = Task::all();
foreach ($tasks as $task) {
echo $task['name'];
/*
if ($task['status'] == 0) {
$data['stories'][] = $task;
} elseif ($task['status'] == 1) {
$data['tasks'][] = $task;
} elseif ($task['status'] == 2) {
$data['tests'][] = $task;
} elseif ($task['status'] == 3) {
$data['done'][] = $task;
}
*/
}
/*
foreach ($tasks as $task) {
if ($task['status'] == 0) {
$data['stories'][] = $task;
} elseif ($task['status'] == 1) {
$data['tasks'][] = $task;
} elseif ($task['status'] == 2) {
$data['tests'][] = $task;
} elseif ($task['status'] == 3) {
$data['done'][] = $task;
}
}
*/
// Load project info
/* $this->load->model('project_model');
$project = $this->project_model->get($project_id);
$this->title = "Project: {$project['name']}";
$this->menu = 'dashboard|edit_project|new_task';
$data['project_id'] = $project_id;
$data['current_user'] = $this->session->userdata('user');
$db_users = $this->project_model->get_related_users($project_id);
$users = array();
foreach ($db_users as $user) {
$users[$user['id']] = $user;
}
$data['users'] = $users;
$this->load->view('task_board', $data); */
}
示例5: generateShow
/**
* Generate list tasks
*
* @return Response
*/
public function generateShow()
{
$datas = array();
if (Auth::check()) {
$datas['tasks'] = Task::all();
}
$datas['labels'] = TasksLabels::all();
return $datas;
/*if (Request::ajax()) {
return Response::json(View::make('theme::' . 'tasks.list', $datas )->renderSections());
} else {
return View::make('theme::' . 'tasks.display', $datas );
}*/
}
示例6: testGetsCurrentTeamTasks
public function testGetsCurrentTeamTasks()
{
auth()->login($this->user);
$task = new Task();
$task->team_id = $this->user->currentTeam->getKey();
$task->name = 'Buy milk';
$task->save();
$task2 = new Task();
$task2->team_id = $this->user->currentTeam->getKey() + 1;
$task2->name = 'Buy steaks';
$task2->save();
$tasks = Task::all();
$this->assertCount(1, $tasks);
$this->assertEquals($task->id, $tasks->first()->id);
$this->assertEquals($task->team_id, $tasks->first()->team_id);
$this->assertEquals($task->name, $tasks->first()->name);
}
示例7: getTasks
public function getTasks()
{
$users = Task::all();
return Response::json($users);
}
示例8: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return Task::all();
}
示例9: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return View::make('tasks.index')->with('tasks', Task::all())->with('title', 'Tasks');
}
示例10: array
$results = array();
foreach ($data as $datum) {
$group = TaskGroup::with_obje($datum);
if ($group) {
$result = $group->save();
$results[] = $result;
} else {
$results[] = null;
}
}
$json = json_encode($results);
break;
case 'task.list':
$datum = json_decode($req_json);
#debug_foreach($datum);
$tasks = Task::all($datum->group_id);
if (empty($tasks)) {
$tasks = array();
}
$json = json_encode($tasks);
break;
case 'task.create':
#debug($req_json);
$datum = json_decode($req_json);
#debug_foreach($datum);
$task = Task::with_obje($datum);
if ($task) {
$result = $task->save();
$task->note()->save();
$json = json_encode($result);
}
示例11: home
public function home()
{
$tasks = Task::all();
return View::make('home', compact('tasks'));
}
示例12: manageTask
public function manageTask()
{
$tasks = Task::all();
return View::make('task.manage')->with('tasks', $tasks);
}
示例13: create
public function create()
{
$tasks = Task::all();
return view('tasks.create')->withTasks($tasks);
}
示例14: function
Route::get('/', function () {
return View::make('admin.projects.index', ['active_link' => 'projects', 'projects' => Project\Project::all()]);
});
});
// ------------------------------------------------------------------------
// Tasks
// ------------------------------------------------------------------------
Route::group(['prefix' => 'tasks'], function () {
Route::get('/', function () {
/*return [
'total'=>Task::all()->count(),
'active_tasks'=>Task::active()->count(),
'expired_tasks'=>Task::expired()->count(),
'calc'=>(Task::active()->count()+Task::expired()->count())
];*/
return View::make('admin.tasks.index', ['active_link' => 'tasks', 'tasks' => Task::all(), 'active_tasks' => Task::active()->get(), 'expired_tasks' => Task::expired()->get()]);
});
});
// ------------------------------------------------------------------------
// Tags CMS
// ------------------------------------------------------------------------
Route::group(['prefix' => 'tags'], function () {
Route::get('/', function () {
return View::make('admin.tags.index', ['active_link' => 'tags']);
});
Route::get('{id}', function ($id) {
return View::make('admin.tags.edit', ['active_link' => 'tags', 'tag' => Tag::find($id)]);
});
Route::post('/', ['uses' => 'TagsController@store']);
Route::put('{id}', ['uses' => 'TagsController@update']);
Route::delete('{id}', ['uses' => 'TagsController@destroy']);