本文整理汇总了PHP中Sections::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Sections::where方法的具体用法?PHP Sections::where怎么用?PHP Sections::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sections
的用法示例。
在下文中一共展示了Sections::where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postGetSections
/**
* Api to get Sections from class
*/
public function postGetSections()
{
$classId = Input::get('class_id');
$sections = Sections::where('class_id', '=', $classId)->get();
$response = array('status' => 'success', 'result' => array('sections' => $sections));
return Response::json($response);
}
示例2: array
File::delete($oldPage->page_url);
}
$rule = array('page_description' => 'required', 'page_name' => 'required', 'page_title' => 'required', 'page_subtitle' => 'required', 'type_of_page' => 'required', 'page_section' => 'required', 'page_shortname' => 'required');
$validator = Validator::make(Input::all(), $rule);
if ($validator->fails()) {
return Redirect::to('/forms')->with('flash_error', 'true')->withInput()->withErrors($validator);
} else {
$first_action_cnt = Input::get('first_action_cnt');
$second_action_cnt = Input::get('second_action_cnt');
$transport_action_cnt = Input::get('transport_cnt');
$action_cnt = Input::get('action_cnt');
$question_cnt = Input::get('question_cnt');
$layout_cnt = Input::get('layout_cnt');
$noreferral_cnt = Input::get('noreferral_cnt');
//
$section = Sections::where('name_of_section', '=', Input::get('page_section'))->first();
$xmlFileName = $section->section_url . '\\' . Input::get('page_shortname') . '.xml';
/*
$page = new Pages;
$page->name_of_page = Input::get('name_of_page');
$page->type_of_page = Input::get('page_type');
$page->page_title = Input::get('page_title');
$page->page_subtitle = Input::get('page_subtitle').": ".Input::get('name_of_page');
$page->page_section = Input::get('page_section');
$page->page_link_value = $section->shortname."/".Input::get('page_shortname');
$page->color_code = Input::get('color_code');
$page->page_shortname = Input::get('page_shortname');
$page->page_url = $xmlFileName;
// */
// $page->save();
$page = DB::table('pages')->where('id', Input::get('id'))->update(array('page_description' => Input::get('page_description'), 'type_of_page' => Input::get('type_of_page'), 'page_name' => Input::get('page_name'), 'page_title' => Input::get('page_title'), 'page_subtitle' => Input::get('page_subtitle') . ": " . Input::get('page_description'), 'page_section' => Input::get('page_section'), 'page_link_value' => $section->shortname . "/" . Input::get('page_shortname'), 'color_code' => Input::get('color_code'), 'page_shortname' => Input::get('page_shortname'), 'page_url' => $xmlFileName));
示例3: postDeleteSections
public function postDeleteSections()
{
$section_id = Input::get('section_id');
$section_name = Input::get('section_name');
$class_id = Input::get('class_id');
if ($section_id) {
$sections = Sections::find($section_id);
} else {
$sections = Sections::where('section_name', '=', $section_name)->where('class_id', '=', $class_id);
}
if ($sections->delete()) {
$response = array('status' => 'success', 'msg' => 'Setting created successfully', 'deleted_item_id' => $section_id);
return Response::json($response);
} else {
$response = array('status' => 'failed', 'msg' => 'Item is Not deleted', 'Item_id' => $section_id);
return Response::json($response);
}
}