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


PHP Sections::all方法代碼示例

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


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

示例1: postCreate

 public function postCreate()
 {
     $all = Sections::all();
     $section = new Sections();
     $section->title = Input::get('title');
     $section->description = Input::get('description');
     $section->type = 'section';
     $section->status = 'draft';
     $section->order = count($all) + 1;
     $section->file = Input::get('file') == 'true' ? true : false;
     if ($section->save()) {
         return Redirect::to($this->route)->with('msg_success', Lang::get('messages.sections_create', array('title' => $section->title, 'description' => $section->description, 'file' => $section->file)));
     } else {
         return Redirect::to($this->route)->with('msg_error', Lang::get('messages.sections_create_err', array('title' => $section->title, 'description' => $section->description, 'file' => $section->file)));
     }
 }
開發者ID:nagyist,項目名稱:abge,代碼行數:16,代碼來源:SectionController.php

示例2: function

    //  return $page_values->page_url;
    return View::make('editSection')->with(['section_values' => $section_values]);
});
Route::get('/delete', function () {
    $page_values = Pages::where('id', '=', Input::get('id'))->first();
    DB::table('pages')->where('id', '=', Input::get('id'))->delete();
    $pages = Pages::all();
    if (File::exists($page_values->page_url)) {
        File::delete($page_values->page_url);
    }
    return View::make('table')->with(['message' => "Page deleted successfully", 'pages' => $pages]);
});
Route::get('/deleteSection', function () {
    $page_values = Sections::where('id', '=', Input::get('id'))->first();
    DB::table('sections')->where('id', '=', Input::get('id'))->delete();
    $sections = Sections::all();
    if (File::exists($page_values->section_url)) {
        File::deleteDirectory($page_values->section_url);
    }
    return View::make('upload')->with(['message' => "Section deleted successfully", 'sections' => $sections]);
});
Route::get('/section', function () {
    return View::make('sections');
});
Route::post('addSection', function () {
    $sections = Sections::where('name_of_section', '=', Input::get('name_of_section'))->first();
    $path = public_path() . '\\' . 'sections\\' . Input::get('shortname');
    $section = ['name_of_section' => Input::get('name_of_section'), 'sub_section' => Input::get('sub_section'), 'shortname' => Input::get('shortname'), 'section_url' => $path];
    $sections = ['name_of_section' => Input::get('name_of_section'), 'sub_section' => Input::get('sub_section'), 'shortname' => Input::get('shortname')];
    $rule = array('name_of_section' => 'required', 'shortname' => 'required');
    $validator = Validator::make($sections, $rule);
開發者ID:GrameenGhana,項目名稱:cch-pointofcarecms-webapp,代碼行數:31,代碼來源:routes.php


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