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


PHP View::getData方法代码示例

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


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

示例1: addView

 /**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     $path = $view->getPath();
     if ($path) {
         $path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
     }
     if (substr($path, -10) == '.blade.php') {
         $type = 'blade';
     } else {
         $type = pathinfo($path, PATHINFO_EXTENSION);
     }
     if (!$this->collect_data) {
         $params = array_keys($view->getData());
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             if (in_array($key, ['__env', 'app', 'errors', 'obLevel', 'currentUser'])) {
                 continue;
             }
             $data[$key] = $this->exportValue($value);
         }
         $params = $data;
     }
     $this->templates[] = array('name' => $path ? sprintf('%s (%s)', $name, $path) : $name, 'param_count' => count($params), 'params' => $params, 'type' => $type);
 }
开发者ID:SmoothPhp,项目名称:laravel-debugbar,代码行数:31,代码来源:ViewCollector.php

示例2: compose

 /**
  * @param View $view
  */
 public function compose(View $view)
 {
     $view->with('currentUser', $this->sentinel->getUser());
     $view->with('mode', array_get($view->getData(), 'mode', ''));
     $view->with('breadcrumbs', config('shapeshifter.breadcrumbs') ? $this->breadcrumbService->breadcrumbs() : []);
     $view->with('menu', $this->menuService->generateMenu());
 }
开发者ID:wearejust,项目名称:shapeshifter,代码行数:10,代码来源:Layout.php

示例3: menuLink

 /**
  * Figures out if the menu item we're displaying should be active
  * @param View $view
  */
 public function menuLink($view)
 {
     $viewData = $view->getData();
     $activeClass = '';
     $item = $viewData['item'];
     $slug = $item->slug !== '' ? $item->slug : $item->url;
     if ($slug == '') {
         $slug = '/foo';
     }
     // it's active if it's an exact match to the slug
     if ('/' . Request::path() == $slug) {
         $activeClass = 'active';
     } else {
         if (strpos('/' . Request::path(), $slug) === 0) {
             // unless the slug is the homepage
             if ($slug !== '/') {
                 $activeClass = 'active';
             }
             if ($slug == '/' && Request::path() == '/') {
                 $activeClass = 'active';
             }
         }
     }
     $clientInfo = Config::get('clientInfo');
     $locale = isset($clientInfo->primary_language->language_code) && App::getLocale() == $clientInfo->primary_language->language_code ? '' : '/' . App::getLocale();
     $link = $item->slug ? URL::to($locale . $item->slug) : $locale . $item->url;
     // translations, if any
     $translations = json_decode($item->translations, true);
     if (isset($translations[App::getLocale()]) && $translations[App::getLocale()] !== '') {
         $item->page_name = $translations[App::getLocale()];
     }
     $view->with('activeClass', $activeClass)->with('link', $link)->with('item', $item);
 }
开发者ID:alistairshaw,项目名称:vendirun-plugin,代码行数:37,代码来源:CmsViewComposer.php

示例4: compose

 /**
  * Bind data to the view.
  *
  * @param  \Illuminate\View\View  $view
  */
 public function compose(View $view)
 {
     foreach (config('arcanesoft.foundation.sidebar.items', []) as $sidebarKey) {
         if (config()->has($sidebarKey)) {
             $this->sidebar->add(config($sidebarKey));
         }
     }
     $this->sidebar->setCurrent(Arr::get($view->getData(), 'current_page', ''));
 }
开发者ID:ARCANESOFT,项目名称:Foundation,代码行数:14,代码来源:SidebarComposer.php

示例5: addView

 /**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     $type = pathinfo($view->getPath(), PATHINFO_EXTENSION);
     if (!$this->collect_data) {
         $params = array_keys($view->getData());
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             if (is_object($value) && method_exists($value, 'toArray')) {
                 $value = $value->toArray();
             }
             $data[$key] = $this->exporter->exportValue($value);
         }
         $params = $data;
     }
     $this->templates[] = array('name' => $name, 'param_count' => count($params), 'params' => $params, 'type' => $type);
 }
开发者ID:nvq247,项目名称:Kxexnxh,代码行数:23,代码来源:ViewCollector.php

示例6: compose

 /**
  * @param $view
  */
 public function compose(View $view)
 {
     $viewData = $view->getData();
     $date = array_has($viewData, 'date') && $viewData['date'] ? $viewData['date'] : Carbon::today();
     $calendar = $this->manager->getCalendar(Carbon::today());
     $lastBillboard = $this->billboardsRepository->findNewer();
     $view->with('calendar', $calendar);
     $view->with('date', $date);
     $view->with('lastBillboard', $lastBillboard);
 }
开发者ID:filmoteca,项目名称:filmoteca,代码行数:13,代码来源:ExhibitionComposer.php

示例7: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $clients = $this->clients->find($view->getData()['client']['id']);
     /**
      * [User assigned the client]
      * @var contact
      */
     $contact = $clients->userAssignee;
     $view->with('contact', $contact);
 }
开发者ID:Bottelet,项目名称:Flarepoint-crm,代码行数:16,代码来源:ClientHeaderComposer.php

示例8: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $tasks = $this->tasks->find($view->getData()['tasks']['id']);
     /**
      * [User assigned the task]
      * @var contact
      */
     $contact = $tasks->assignee;
     $client = $tasks->clientAssignee;
     $view->with('contact', $contact);
     $view->with('client', $client);
 }
开发者ID:Bottelet,项目名称:Flarepoint-crm,代码行数:18,代码来源:TaskHeaderComposer.php

示例9: address

 /**
  * @param View $view
  */
 public function address($view)
 {
     $viewData = $view->getData();
     $address = ['id' => '', 'address1' => '', 'address2' => '', 'address3' => '', 'city' => '', 'state' => '', 'postcode' => '', 'countryId' => ''];
     if (isset($viewData['address']) && $viewData['address']) {
         foreach ($viewData['address'] as $key => $value) {
             $address[$key] = $value;
         }
     }
     $view->with('address', $address);
     if (!isset($viewData['prefix'])) {
         $view->with('prefix', '');
     }
 }
开发者ID:alistairshaw,项目名称:vendirun-plugin,代码行数:17,代码来源:CustomerViewComposer.php

示例10: compose

 public function compose(View $view)
 {
     $data = $view->getData();
     if (Auth::check()) {
         $this->putUserInfo();
     }
     if (array_key_exists('group', $data) && $data['group'] instanceof Group) {
         JavaScript::put(['group' => $data['group']]);
     }
     if (array_key_exists('content', $data) && $data['content'] instanceof Content) {
         JavaScript::put(['content' => $data['content']->toArray()]);
     }
     JavaScript::put(['config' => ['env' => app()->environment(), 'pusher_key' => config('broadcasting.connections.pusher.key')]]);
 }
开发者ID:vegax87,项目名称:Strimoid,代码行数:14,代码来源:JavascriptComposer.php

示例11: compose

 /**
  * Composer for updating a course
  * @param View $view
  */
 public function compose(View $view)
 {
     $course = $view->getData()['course'];
     $empty_link = new Link(['link' => "", 'name' => ""]);
     $empty_link->id = 0;
     $links = \Link::getAllLinks($course);
     $length = count($links) > 0 ? $links[count($links) - 1]->id + 1 : 1;
     \JavaScript::put(['links' => $length]);
     $view->with('empty_link', $empty_link);
     $view->with('images', \Image::listImages($course));
     $view->with('videos', \Video::listVideos($course));
     $view->with('ebooks', \Ebook::listEbooks($course));
     $view->with('links', $links);
     $view->with('body', \Resource::getCourseBody($course));
 }
开发者ID:bohap,项目名称:online-study,代码行数:19,代码来源:UpdateCourseComposer.php

示例12: compose

 /**
  * Composer for showing a course
  * @param View $view
  */
 public function compose(View $view)
 {
     $course = $view->getData()['course'];
     $view->with('course_categories', \Category::getCourseCategories($course));
     $view->with('images', \Image::listImagesWithCleanPath($course));
     $view->with('videos', \Video::listVideosWithCleanPath($course));
     $view->with('ebooks', \Ebook::listEbooksWithCleanPath($course));
     $view->with('links', \Link::listLinksWithNames($course));
     $view->with('created_at', \MyCarbon::format($course->created_at->diffForHumans()));
     $view->with('course_user', $course->user);
     $view->with('count_likes', \Course::countLikes($course));
     $view->with('count_dislikes', \Course::countDislikes($course));
     if (Auth::check()) {
         \JavaScript::put(['star_index' => \Course::getLikeRating($course, Auth::user())]);
     }
 }
开发者ID:bohap,项目名称:online-study,代码行数:20,代码来源:ShowCourseComposer.php

示例13: addView

 /**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     if (!$this->collect_data) {
         $this->views[] = $name;
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             if (is_object($value) and method_exists($value, 'toArray')) {
                 $data[$key] = $value->toArray();
             } else {
                 $data[$key] = $value;
             }
         }
         $this->views[] = $name . ' => ' . $this->formatVar($data);
     }
 }
开发者ID:aaronbullard,项目名称:litmus,代码行数:22,代码来源:ViewCollector.php

示例14: slider

 /**
  * @param View $view
  */
 public function slider($view)
 {
     $viewData = $view->getData();
     if (!isset($viewData['options'])) {
         $viewData['options'] = json_decode($viewData['element']->element_options, true);
     }
     $slider_id = $viewData['options']['id'];
     try {
         $slider = VendirunApi::makeRequest('cms/slider', ['id' => $slider_id])->getData();
         $sliderStyles = $this->getSliderStyles($slider);
         $slideStyles = $this->getSlideStyles($slider);
     } catch (FailResponseException $e) {
         $slider = false;
         $sliderStyles = [];
         $slideStyles = [];
     }
     $view->with('slider', $slider)->with('sliderStyles', $sliderStyles)->with('slideStyles', $slideStyles);
 }
开发者ID:alistairshaw,项目名称:vendirun-plugin,代码行数:21,代码来源:WidgetViewComposer.php

示例15: addView

 /**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     if (!$this->collect_data) {
         $this->data[$name] = $name;
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             if (is_object($value)) {
                 if (method_exists($value, 'toArray')) {
                     $data[$key] = $value->toArray();
                 } else {
                     $data[$key] = "Object (" . get_class($value) . ")";
                 }
             } else {
                 $data[$key] = $value;
             }
         }
         $this->data[$name] = $data;
     }
 }
开发者ID:robStack,项目名称:CoDev,代码行数:26,代码来源:ViewCollector.php


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