当前位置: 首页>>代码示例>>PHP>>正文


PHP Section::find方法代码示例

本文整理汇总了PHP中Section::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Section::find方法的具体用法?PHP Section::find怎么用?PHP Section::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Section的用法示例。


在下文中一共展示了Section::find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionView

 public function actionView($id)
 {
     $sections = Section::find()->all();
     $model = Section::find()->where(['id' => $id])->one();
     $mips = Mip::find()->where(['section_id' => $id])->all();
     return $this->render('view', ['sections' => $sections, 'model' => $model, 'mips' => $mips]);
 }
开发者ID:uraankhayayaal,项目名称:aic.s-vfu.ru,代码行数:7,代码来源:SectionController.php

示例2: getSectionAction

 public function getSectionAction()
 {
     if ($this->request->isPost() == true) {
         $sections = Section::find();
         foreach ($sections as $sectionItem) {
         }
     }
 }
开发者ID:hyfjjjj,项目名称:HHA-Web,代码行数:8,代码来源:SectionController.php

示例3: update

 /**
  * Update the specified resource in storage.
  * PUT /sections/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $section = Section::where('id', $id)->update(Input::all());
     if ($section) {
         $data = Section::find($id);
         return ['status' => true, 'data' => $data];
     } else {
         return ['status' => false];
     }
 }
开发者ID:sahilkathpal,项目名称:hackcoin,代码行数:17,代码来源:SectionsController.php

示例4: Section

    function nav_sub_section($type,$sort) {
	   $finder= new Section(AMP_Registry::getDbcon());
		if(isset($sort) && $sort){
        	$finder_source = &$finder->getSearchSource();
        	$finder_source->addSort($sort);
		}
    	$sections = $finder->find(array('parent'=>$type,'displayable'=>'1'));
        if (!$sections) return;
        $html = '<ul>';
    	foreach($sections as $section) {
	       		$html .= '<li><a href="section.php?id='.$section->id.'">'.$section->getName().'</a><img src="img/spacer.gif" height="4" width="3" align="left"> </li>'; 
	   }
    	$html .= '</ul>'; 
	   return $html;
    }
开发者ID:radicalsuz,项目名称:amp,代码行数:15,代码来源:MainMenu.php

示例5: Section

 function nav_sub_section($type, $sort)
 {
     $finder = new Section(AMP_Registry::getDbcon());
     if (isset($sort) && $sort) {
         $finder_source =& $finder->getSearchSource();
         $finder_source->addSort($sort);
     }
     $sections = $finder->find(array('parent' => $type, 'displayable' => '1'));
     if (!$sections) {
         return;
     }
     $html = '<ul>';
     foreach ($sections as $section) {
         if (AMP_CONTENT_HUMANIZE_URLS) {
             $sectionURL = AMP_url_update('section.php', array('id' => $section->id));
         } else {
             $sectionURL = 'section.php?id=' . $section->id;
         }
         $html .= '<li><a href="' . $sectionURL . '">' . $section->getName() . '</a><img src="img/spacer.gif" height="4" width="3" align="left"> </li>';
     }
     $html .= '</ul>';
     return $html;
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:23,代码来源:MainMenu.php

示例6: putAction

 public function putAction()
 {
     if ($this->request()->isPost() == true) {
         $ans = [];
         try {
             $id = $this->request->getPost("id");
             $sectionNewName = $this->request->getPost("name");
             $existArticle = Article::find(array("conditions" => "id=?1", "bind" => array(1 => $id)));
             if (count($existArticle) == 0) {
                 $ans['ret'] = -1;
                 $ans['error'] = 204;
                 echo json_encode($ans);
                 throw new BaseException('文章不存在', 204);
             } else {
                 $existSection = Section::find(array("conditions" => "name=?1", "bind" => array(1 => $sectionNewName)));
                 if (count($existSection) == 0) {
                     $ans['ret'] = -1;
                     $ans['error'] = 105;
                     echo json_encode($ans);
                     throw new BaseException('栏目不存在', 105);
                 } else {
                     $existArticle->section_id = $existSection->id;
                     if ($existArticle->save() == true) {
                         $ans['ret'] = 0;
                         echo json_encode($ans);
                     } else {
                         $ans['ret'] = -1;
                         $ans['error'] = 102;
                         echo json_encode($ans);
                         throw new BaseException('参数存在非法数据', 102);
                     }
                 }
             }
         } catch (BaseException $e) {
         }
     }
 }
开发者ID:hyfjjjj,项目名称:HHA-Web,代码行数:37,代码来源:ArticlePathController.php

示例7: postDetach

 public function postDetach()
 {
     if (Input::has('id') && Input::has('section_id')) {
         $section_id = Input::get('section_id');
         $id = Input::get('id');
         Workorder::find($id)->sections()->detach(Section::find($section_id));
         return ['status' => true];
     } else {
         return ['status' => false];
     }
 }
开发者ID:sahilkathpal,项目名称:hackcoin,代码行数:11,代码来源:WorkordersController.php

示例8: strtoupper

						{{Form::button('Cancel', ['class' => 'btn btn-default cancel-edit mode2'])}}
						<a href="/workflow/replace/{{$section->id}}" title="Description" data-placement="top" data-method="post" data-replace="#description_body"  class="btn ajax btn-info" data-toggle="modal" data-target="#description"  onclick="empty_div()"><span class="glyphicon glyphicon-list-alt"></span></a><br>
					</td>
				</tr>

				@endif
			@endforeach
		</table>
	</div>
</div>

<!-- VOUCHER SECTION -->
<div class="panel panel-success">
	<div class="panel-heading">
		<?php 
$sectionName = Section::find('8');
?>
		<h3 class="panel-title">{{{ strtoupper($sectionName->sectionName) }}}</h3>
	</div>
	<div class="panel-body">
				
		<!-- Displays form for adding new tasks to the workflow -->
		<div id="office-create-form" class="well div-form">
		    	{{ Form::open(['url'=>'addtask'], 'POST', array('role' => 'form')) }}
			    	<div class="col-md-8">
				    	{{ Form::text('label', null, array('class' => 'form-control', 'placeholder' => 'Enter field label here','maxlength'=>'45')) }}
				    		    <input type ="hidden" name="section_id" value="{{$sectionName->id}}">
				    </div>
			
				    <div class="col-md-3">
				    	{{ Form::submit('Add', array('class' => 'btn btn-success btn-block create-btn')) }}
开发者ID:iHunt101,项目名称:procurementTrackingSystem,代码行数:31,代码来源:workflow2.blade.php

示例9: getAction

 public function getAction($id)
 {
     if ($this->request->isGet() == true) {
         $ans = [];
         try {
             $existArticle = Article::find(array("conditions" => "id=?1", "bind" => array(1 => $id)));
             if (count($existArticle) == 0) {
                 $ans['ret'] = -1;
                 $ans['error'] = 204;
                 echo json_encode($ans);
                 throw new BaseException("要查找的文章不存在", 204);
             } else {
                 $data = [];
                 $data['title'] = $existArticle->title;
                 $data['date'] = $existArticle->date;
                 $data['body'] = $existArticle->body;
                 $sectionId = $existArticle->section_id;
                 $conditions = "id =:id:";
                 $parameters = array("id" => $sectionId);
                 $temp_section = Section::find(array($conditions, "bind" => $parameters));
                 $data['section'] = $temp_section->name;
                 $ans['ret'] = 0;
                 $ans['data'] = $data;
                 echo json_encode($ans);
             }
         } catch (BaseException $e) {
         }
     }
 }
开发者ID:hyfjjjj,项目名称:HHA-Web,代码行数:29,代码来源:ArticleController.php

示例10: strtoupper

							{{Form::button('Save', ['class' => 'btn btn-success save-edit mode2', 'id' => 'temp_alert'])}}
							{{Form::button('Cancel', ['class' => 'btn btn-default cancel-edit mode2'])}}
							<a href="/workflow/replace/{{$section->id}}" title="Description" data-placement="top" data-method="post" data-replace="#description_body"  class="btn ajax btn-info" data-toggle="modal" data-target="#description"  onclick="empty_div()"><span class="glyphicon glyphicon-list-alt"></span></a><br>
						</td>
					</tr>
				@endif
			@endforeach
		</table>
	</div>
</div>

<!-- VOUCHER SECTION -->
<div class="panel panel-success">
	<div class="panel-heading">
		<?php 
$sectionName = Section::find('19');
?>
		<h3 class="panel-title">{{{ strtoupper($sectionName->sectionName) }}}</h3>
	</div>

	<div class="panel-body">

		<!-- Displays the tasks added through the add new task form -->
		<div id="office-create-form" class="well div-form">
	    	{{ Form::open(['url'=>'addtask'], 'POST', array('role' => 'form')) }}
		    	<div class="col-md-8">
			    	{{ Form::text('label', null, array('class' => 'form-control', 'placeholder' => 'Enter field label here','maxlength'=>'45')) }}
			    		    <input type ="hidden" name="section_id" value="{{$sectionName->id}}">
			    </div>
		
			    <div class="col-md-3">
开发者ID:iHunt101,项目名称:procurementTrackingSystem,代码行数:31,代码来源:workflow5.blade.php

示例11: array

     $langs = DB::table('langs')->lists('language', 'id');
     $langs = array("0" => "Select") + $langs + array("-1" => "Others");
     $levels = DB::table('levels')->lists('level', 'id');
     $abilities = DB::table('abilities')->lists('ability', 'id');
     return View::make('cvbuilder.section_views.language', array("langs" => $langs, "levels" => $levels, "abilities" => $abilities));
 });
 Route::post('/fetch_workex', 'CVController@postWorkex');
 Route::post('/fetch_education', 'CVController@postEducation');
 Route::post('/fetch_nysc', 'CVController@postNysc');
 Route::post('/fetch_language', 'CVController@postLanguage');
 Route::post('/save', 'CVController@postProfile');
 Route::get('/fetch_ui_section', function () {
     return View::make('cvbuilder.section_views.add_new_section');
 });
 Route::get('/edit_ui_section/{id}', function ($id) {
     $section = Section::find($id);
     return View::make('cvbuilder.section_views.edit_new_section', ['section' => $section]);
 });
 Route::get('/edit_ui_workex/{id}', function ($id) {
     $work = WorkExperience::find($id);
     return View::make('cvbuilder.section_views.edit_work', ['work' => $work]);
 });
 Route::get('/edit_ui_education/{id}', function ($id) {
     $education = Education::find($id);
     return View::make('cvbuilder.section_views.edit_education', ['edu' => $education]);
 });
 Route::get('/edit_ui_nysc/{id}', function ($id) {
     $nysc = Nysc::find($id);
     return View::make('cvbuilder.section_views.edit_nysc', ['nysc' => $nysc]);
 });
 Route::get('/edit_ui_language/{id}', function ($id) {
开发者ID:vishu87,项目名称:cpr,代码行数:31,代码来源:routes.php

示例12: postUpdateTrainerSection

 public function postUpdateTrainerSection()
 {
     $sid = Input::get('sid');
     $tid = Input::get('tid');
     $section = Section::find($sid);
     $trainer = Trainer::find($tid);
     $trainer->section()->associate($section);
     $trainer->save();
 }
开发者ID:uTosTan,项目名称:codesamples,代码行数:9,代码来源:AdminController.php

示例13: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $this->section->find($id)->delete();
     return Redirect::route('sections.index');
 }
开发者ID:bailey9005,项目名称:Laravel-For-Landing-Pages,代码行数:11,代码来源:SectionsController.php

示例14: strtoupper

							{{Form::button('Save', ['class' => 'btn btn-success save-edit mode2', 'id' => 'temp_alert'])}}
							{{Form::button('Cancel', ['class' => 'btn btn-default cancel-edit mode2'])}}
							<a href="/workflow/replace/{{$section->id}}" title="Description" data-placement="top" data-method="post" data-replace="#description_body"  class="btn ajax btn-info" data-toggle="modal" data-target="#description"  onclick="empty_div()"><span class="glyphicon glyphicon-list-alt"></span></a><br>
						</td>
					</tr>
				@endif
			@endforeach
		</table>
	</div>
</div>

<!-- VOUCHER SECTION -->
<div class="panel panel-success">
	<div class="panel-heading">
		<?php 
$sectionName = Section::find('4');
?>
		<h3 class="panel-title"> {{{ strtoupper($sectionName->sectionName) }}} </h3>
	</div>

	<div class="panel-body">
		
		<!-- Displays the tasks added through the add new task form -->
		<div id="office-create-form" class="well div-form">
		    	{{ Form::open(['url'=>'addtask'], 'POST', array('role' => 'form')) }}
			    	<div class="col-md-8">
				    	{{ Form::text('label', null, array('class' => 'form-control', 'placeholder' => 'Enter field label here','maxlength'=>'45')) }}
				    		    <input type ="hidden" name="section_id" value="{{$sectionName->id}}">
				    </div>
			
				    <div class="col-md-3">
开发者ID:iHunt101,项目名称:procurementTrackingSystem,代码行数:31,代码来源:workflow1.blade.php

示例15: GetByName

 public static function GetByName($sectionName)
 {
     return Section::find(array('section_name' => $sectionName));
 }
开发者ID:krasaler,项目名称:FamilyStore,代码行数:4,代码来源:SectionService.php


注:本文中的Section::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。