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


PHP Language::whereSectionId方法代码示例

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


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

示例1: show

 /**
  * Display the specified resource.
  *
  * @param Request $request
  * @param CV $cv
  * @return \Illuminate\Http\Response
  */
 public function show(Request $request, CV $cv)
 {
     // Get the cv sections.
     $sections = $cv->sections()->get();
     // Build empty subsections.
     $workSection = array();
     $languageSection = array();
     $educationSection = array();
     $hobbySection = array();
     $skillSection = array();
     // For each section, determine it's type, and append it's data to the corresponding subsection.
     foreach ($sections as $section) {
         $w = Work::whereSectionId($section->id)->get(['name', 'location', 'title', 'description', 'start_date', 'end_date'])->toArray();
         $l = Language::whereSectionId($section->id)->get(['name', 'level', 'creditation'])->toArray();
         $e = Education::whereSectionId($section->id)->get(['name', 'location', 'title', 'description', 'start_date', 'end_date'])->toArray();
         $h = Hobby::whereSectionId($section->id)->get(['text'])->toArray();
         $s = Skill::whereSectionId($section->id)->get(['name', 'level', 'description'])->toArray();
         if (count($w) != 0) {
             array_push($workSection, $w);
         }
         if (count($l) != 0) {
             array_push($languageSection, $l);
         }
         if (count($e) != 0) {
             array_push($educationSection, $e);
         }
         if (count($h) != 0) {
             array_push($hobbySection, $h);
         }
         if (count($s) != 0) {
             array_push($skillSection, $s);
         }
     }
     return view('pages.cvs.show', ['cv' => $cv, 'user' => $request->user(), 'workSection' => $workSection, 'languageSection' => $languageSection, 'educationSection' => $educationSection, 'hobbySection' => $hobbySection, 'skillSection' => $skillSection]);
 }
开发者ID:Arnianor,项目名称:CVGenerator,代码行数:42,代码来源:CVController.php


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