當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Page::destroy方法代碼示例

本文整理匯總了PHP中app\Page::destroy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Page::destroy方法的具體用法?PHP Page::destroy怎麽用?PHP Page::destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Page的用法示例。


在下文中一共展示了Page::destroy方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: destroy

 public function destroy(Page $page)
 {
     if (\Request::has('id')) {
         Page::destroy(\Request::input('id'));
         return ['result' => true];
     }
     $page->delete();
     return redirect('dash/page')->with('message', 'Page was delete success.');
 }
開發者ID:ravuthz,項目名稱:cms-laravel5.1,代碼行數:9,代碼來源:PageController.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     /* $page = Page::find($id);
             $page->delete();
     
             return Redirect::to('admin');*/
     if (Page::destroy($id)) {
         return Response::json(array('success' => true, 'type' => 'delete'));
     } else {
         return Response::json(array('success' => false, 'type' => 'delete'));
     }
 }
開發者ID:dmodaii,項目名稱:laravel5.1-angular,代碼行數:18,代碼來源:PagesController.php

示例3: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     Session::flash('flash_message', 'Stránka byla smazána.');
     return redirect()->route('pages.index');
 }
開發者ID:jZejda,項目名稱:oplanManager,代碼行數:12,代碼來源:PagesController.php

示例4: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
 }
開發者ID:jmeyers44,項目名稱:liftmetrix-project,代碼行數:10,代碼來源:PagesController.php

示例5: deleteForumTopicAction

 public function deleteForumTopicAction($page_id)
 {
     $page = Page::where('id', '=', $page_id)->first();
     if ($page->is_sheet) {
         $messages = ForumPageMessage::where('page_id', '=', $page->id)->get();
         foreach ($messages as $message) {
             ForumPageMessage::destroy($message->id);
         }
     } else {
         $child_pages = Page::where('parent_id', '=', $page->id)->get();
         foreach ($child_pages as $child_page) {
             $messages = ForumPageMessage::where('page_id', '=', $child_page->id);
             foreach ($messages as $message) {
                 ForumPageMessage::destroy($message->id);
             }
             Page::destroy($child_page->id);
         }
     }
     Page::destroy($page->id);
     return redirect('/admin/contents/forum/' . $page->parent_id);
 }
開發者ID:chelizminska,項目名稱:laravel_new,代碼行數:21,代碼來源:BaseController.php

示例6: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     return redirect('/admin/pages')->with('status', 'Страница удалена!');
 }
開發者ID:AbuLoot,項目名稱:unichina,代碼行數:11,代碼來源:AdminPagesController.php

示例7: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $page = Page::destroy($id);
     flash()->success('Page Deleted');
     return redirect('pages');
 }
開發者ID:chrismoulins,項目名稱:Laravel,代碼行數:12,代碼來源:PageController.php

示例8: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     Session::flash('flash_message', 'Page deleted!');
     return redirect('page');
 }
開發者ID:AleksandrKovalev,項目名稱:laravel_blog,代碼行數:13,代碼來源:PageController.php

示例9: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     return redirect('/admin/pages');
 }
開發者ID:hathway,項目名稱:TUI_CMS_POC,代碼行數:11,代碼來源:PagesController.php

示例10: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     return redirect()->route('page.index');
 }
開發者ID:edrobotij,項目名稱:portfolio,代碼行數:11,代碼來源:PageController.php

示例11: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     Flash::success("Запись - {$id} удалена");
     return redirect(route('admin.pages.index'));
 }
開發者ID:jambik,項目名稱:sellmecar,代碼行數:12,代碼來源:PagesController.php

示例12: delete

 public function delete(Request $request)
 {
     //locations to be deleted
     $data = [];
     //check for single delete
     if (isset($request->id)) {
         $data[] = $request->id;
     }
     //check for mass delete if no single delete
     if (empty($data)) {
         $data = $request->input('page_id');
     }
     //delete
     if (!empty($data)) {
         Page::destroy($data);
         //clear cache, set message, redirect to list
         Cache::flush();
         session()->flash('message', trans('admin_common.Page deleted'));
         return redirect(url('admin/page'));
     }
     //nothing for deletion set message and redirect
     session()->flash('message', trans('admin_common.Nothing for deletion'));
     return redirect(url('admin/page'));
 }
開發者ID:gdinko,項目名稱:dclassifieds.laravel,代碼行數:24,代碼來源:PageController.php


注:本文中的app\Page::destroy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。