本文整理汇总了PHP中Title::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Title::find方法的具体用法?PHP Title::find怎么用?PHP Title::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Title
的用法示例。
在下文中一共展示了Title::find方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
if ($validator->fails()) {
return Redirect::to('/account/view_title/' . $title_id)->withInput()->withErrors($validator)->with('message', '輸入錯誤,請檢查');
} else {
$data = Input::all();
$title = Title::find($titleId);
if ($title->update($data)) {
$message = '更新職稱《' . $data['title_name'] . '》完成';
} else {
$message = '資料寫入錯誤';
}
return Redirect::to('/account/view_title/' . $titleId)->with('message', $message);
}
});
// 執行刪除職稱
Route::get('/delete_title/{titleId}', function ($titleId) {
$title = Title::find($titleId);
$message = '刪除《' . $title->title_name . '》完成';
$title->delete();
return Redirect::to('account/')->with('message', $message);
});
});
/**
* 班級、年級管理
*/
Route::group(array('prefix' => 'class_year', 'before' => 'auth'), function () {
// 讀取年級列表
$GLOBALS['yearList'] = Year::orderBy('year_name')->get();
// 顯示年級列表、年級新增表單
Route::get('/', function () {
return View::make('class_year')->with(array('yearList' => $GLOBALS['yearList'], 'year' => NULL));
});
示例2: must_allow
<?php
require_once __DIR__ . "/includes/root.php";
must_allow("modify titles");
$title = Title::find($_REQUEST["id"]);
if ($title == NULL) {
$renderer->flash_alert("Unable to find the requested title");
header("Location: title-list.php");
exit;
}
$renderer->variable("pub", $title);
$renderer->variable("title", sprintf("Editing %s", $title->title));
$renderer->render("title-form");
示例3: updateMovieBrokenLink
public function updateMovieBrokenLink()
{
$id = Input::get('id');
$movie = Title::find($id);
$movie->reindexed = 'Broken Link';
$respuesta = $movie->save();
$rows[] = array('id' => '1', 'value' => trans('main.errorMessageBrokenLink'));
return json_encode($rows);
}
示例4: array
Route::get('typeahead-actor/{query}', array('uses' => 'SearchController@castTypeAhead', 'as' => 'typeahead-cast'));
//homepage and footer
Route::get('/', array('as' => 'home', 'uses' => 'HomeController@index'));
Route::get(Str::slug(trans('main.privacyUrl')), array('uses' => 'HomeController@privacy', 'as' => 'privacy'));
Route::get(Str::slug(trans('main.tosUrl')), array('uses' => 'HomeController@tos', 'as' => 'tos'));
Route::get(Str::slug(trans('main.contactUrl')), array('uses' => 'HomeController@contact', 'as' => 'contact'));
Route::post(Str::slug(trans('main.contactUrl')), array('uses' => 'HomeController@submitContact', 'as' => 'submit.contact'));
//news
Route::resource(Str::slug(trans('main.news')), 'NewsController');
Route::post('news/external', array('uses' => 'NewsController@updateFromExternal', 'as' => 'news.ext'));
//movies/series
// Move this to MoviesController@updateMovieBrokenLink
// Route::get(Str::slug(trans('main.movies')) . '/updateMovieBrokenLink', 'MoviesController@updateMovieBrokenLink');
Route::get(Str::slug(trans('main.movies')) . '/updateMovieBrokenLink', function () {
$id = Input::get('id');
$movie = Title::find($id);
$movie->reindexed = 'Broken Link';
$respuesta = $movie->save();
$rows[] = array('id' => '1', 'value' => trans('main.errorMessageBrokenLink'));
return json_encode($rows);
// return Input::get('id');
});
Route::resource(Str::slug(trans('main.movies')), 'MoviesController');
//lists(watchlist/favorites)
Route::controller('lists', 'ListsController');
//reviews
Route::resource(Str::slug(trans('main.movies')) . '.reviews', 'ReviewController', array('only' => array('store', 'destroy')));
Route::post(Str::slug(trans('main.movies')) . '/{title}/reviews', 'ReviewController@store');
//people
Route::resource(Str::slug(trans('main.people')), 'ActorController');
Route::get('actors', array('uses' => 'ActorController@index'));
示例5: postFinaltitlestage
public function postFinaltitlestage()
{
$new_title_id = Input::get("title_id");
// Gets this from a hidden input element
if ($mode = Input::has('publish_title')) {
$title = Title::find($new_title_id);
$title->status_id = 3;
// active status in statuses table
$title->save();
return Redirect::to('/title/list');
} else {
return Redirect::to('/title/list');
}
}
示例6: must_allow
<?php
require_once __DIR__ . "/includes/root.php";
must_allow("modify titles");
$id = $_POST["id"];
if ($id == NULL || $id == "") {
$title = new Title();
$action = "new title";
} else {
$title = Title::find($id);
if ($title == NULL) {
$renderer->flash_alert("Unable to find requested title; aborting edit");
header("Location: title-list.php");
exit(0);
}
$action = "edit title";
}
$audit_changes = array();
$fields = array("title", "embargoed", "rights", "is_historic");
if (!$title->validlccn || permitted(get_user(), "modify validated lccns")) {
array_push($fields, "lccn");
}
if (permitted(get_user(), "modify title sftp")) {
$fields = array_merge($fields, array("sftpdir", "sftpuser", "sftppass"));
}
$lccn_changed = FALSE;
foreach ($fields as $field) {
$orig = $title->{$field};
$new = $_POST[$field];
if ($orig == $new) {
continue;