コード例 #1
0
ファイル: LoadUsers.php プロジェクト: aguila302/oficios
 public function compose(View $view)
 {
     $documentForm = \Request::only('responsable_id');
     $route = Route::currentRouteName();
     $users = User::orderBy('name', 'ASC')->lists('name', 'id')->toArray();
     $view->with(compact('documentForm', 'users', 'route'));
 }
コード例 #2
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     if ($this->auth->check()) {
         $view->with('auth', $this->user);
         $view->with('dashboard', $this->dashboardService->dashboard());
     }
 }
コード例 #3
0
 /**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     $path = $view->getPath();
     if (!is_object($path)) {
         if ($path) {
             $path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
         }
         if (substr($path, -10) == '.blade.php') {
             $type = 'blade';
         } else {
             $type = pathinfo($path, PATHINFO_EXTENSION);
         }
     } else {
         $type = get_class($view);
         $path = '';
     }
     if (!$this->collect_data) {
         $params = array_keys($view->getData());
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             $data[$key] = $this->exporter->exportValue($value);
         }
         $params = $data;
     }
     $this->templates[] = array('name' => $path ? sprintf('%s (%s)', $name, $path) : $name, 'param_count' => count($params), 'params' => $params, 'type' => $type);
 }
コード例 #4
0
 /**
  * Applies site wide variables to main layout.
  *
  * @param $view
  */
 public function compose(View $view)
 {
     $siteTitle = $this->config->get('site.title.main');
     $currentUser = $this->sentry->getCurrentUser();
     $view->with('siteTitle', $siteTitle);
     $view->with('currentUser', $currentUser);
 }
コード例 #5
0
 public function compose(View $view)
 {
     $mainMenu = $this->pages->with('translation')->whereHas('menuPositions', function ($query) {
         $query->where('id', 2);
     })->get()->toHierarchy();
     $view->with('mainMenu', $mainMenu);
 }
コード例 #6
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     if ($this->djs == null) {
         $this->djs = DJ::orderBy('name', 'asc')->get();
     }
     $view->with('djs', $this->djs);
 }
コード例 #7
0
 /**
  * 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);
 }
コード例 #8
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $cart = count(Session::get('cart'));
     $categoryModel = new Category();
     $baseCategories = $categoryModel->getAllCategories();
     $view->with('categories', $baseCategories)->with('cart', $cart);
 }
コード例 #9
0
 /**
  * Bind data to the view.
  *
  * @param View $view
  */
 public function create(View $view)
 {
     if ($this->googleTagManager->isEnabled() && empty($this->googleTagManager->id())) {
         throw new ApiKeyNotSetException();
     }
     $view->with('enabled', $this->googleTagManager->isEnabled())->with('id', $this->googleTagManager->id())->with('dataLayer', $this->googleTagManager->getDataLayer());
 }
コード例 #10
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $productAttrobuteModel = new ProductAttribute();
     $isFeaturedOptions = $productAttrobuteModel->getIsFeaturedOptions();
     $statusOptions = $productAttrobuteModel->getStatusOptions();
     $view->with('isFeaturedOptions', $isFeaturedOptions)->with('statusOptions', $statusOptions);
 }
コード例 #11
0
 public function prepare(View $view, array $parameters)
 {
     //dd($parameters);
     //grab the single post that match's the id in the parameters or routing data sent
     $post = $this->posts->where('id', $parameters['id'])->where('slug', $parameters['slug'])->first();
     $view->with('post', $post);
 }
コード例 #12
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $user = $this->user->find($this->user_auth->id);
     $notifications = $user->notifications()->noread()->get();
     $notificationsCount = $notifications->count();
     $view->with(['notifications' => $notifications, 'notificationsCount' => $notificationsCount]);
 }
コード例 #13
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $user = Cache::remember('user', 1440, function () {
         return Auth::user();
     });
     $view->with('user', $user);
 }
コード例 #14
0
 /**
  * Set the content for the reponse.
  *
  * @return \Illuminate\View\View
  */
 public function setContent($view, $data = [])
 {
     if (!is_null($this->layout)) {
         return $this->layout->nest('content', $view, $data);
     }
     return view($view, $data);
 }
コード例 #15
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     if ($this->shows == null) {
         $this->shows = Show::orderBy('name', 'asc')->get();
     }
     $view->with('shows', $this->shows);
 }
コード例 #16
0
ファイル: Views.php プロジェクト: marvinlabs/baobab
 /**
  * Use this in your templates to render views returned by the controllers
  *
  * @param \Illuminate\View\View $view The view to be rendered
  */
 public static function render($view)
 {
     try {
         echo $view->render();
     } catch (\Exception $e) {
         echo $e->getMessage();
     }
 }
コード例 #17
0
 /**
  * composing the view
  *
  * @param \Illuminate\View\View $view
  */
 public function compose(\Illuminate\View\View $view)
 {
     $notifications = [];
     if (null !== ($user = $this->authManager->user())) {
         $notifications = $this->notificationManager->getForUser($user, [NotificationActivity::CREATED, NotificationActivity::READ]);
     }
     $view->with('notifications', $notifications);
 }
コード例 #18
0
ファイル: CartComposer.php プロジェクト: chyupa/Beta-Baroko
 public function compose(View $view)
 {
     $sessionId = session()->getId();
     $sessionCartItems = $this->sessionCartRepo->getCartItemsNumber($sessionId);
     $sessionCart = $this->sessionCartRepo->getCartBySessionId($sessionId);
     $totals = $this->sessionCartRepo->calculateTotalBySessionId($sessionCart);
     $view->with('cart_items_number', $sessionCartItems)->with('cart_items_transport_fee', $totals['transportFee'])->with('cart_items_total', $totals['total']);
 }
コード例 #19
0
ファイル: UserHelpComposer.php プロジェクト: josevh/timegrid
 /**
  * Bind data to the view.
  *
  * @param View $view
  *
  * @return void
  */
 public function compose(View $view)
 {
     $locale = app()->getLocale();
     $filename = Request::route()->getName() . '.md';
     $filepath = 'userhelp' . DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR . $filename;
     $help = Storage::exists($filepath) ? Markdown::convertToHtml(Storage::get($filepath)) : '';
     $view->with('help', $help);
 }
コード例 #20
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $productAttrobuteModel = new ProductAttribute();
     $trackStockOptions = $productAttrobuteModel->getTrackStockOptions();
     $inStockOptions = $productAttrobuteModel->getInStockOptions();
     $isTaxableOptions = $productAttrobuteModel->getIsTaxableOptions();
     $view->with('isTaxableOptions', $isTaxableOptions)->with('trackStockOptions', $trackStockOptions)->with('inStockOptions', $inStockOptions);
 }
コード例 #21
0
 /**
  * Execute an action on the controller.
  *
  * @param  string  $method
  * @param  array   $parameters
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function callAction($method, $parameters)
 {
     $this->setupLayout();
     $response = call_user_func_array(array($this, $method), $parameters);
     if ($response instanceof View && !$this->layout->offsetExists('content')) {
         return $this->layout->with('content', $response);
     }
     return $response;
 }
コード例 #22
0
 /**
  * @param $view
  *
  * @return mixed
  */
 public function compose(View $view)
 {
     $priorities = $this->priority->all()->lists('name', 'id')->toArray();
     /*
      * Default selected None value
      */
     $priorities[null] = 'Select a Priority';
     return $view->with('priorities', $priorities);
 }
コード例 #23
0
ファイル: Compile.php プロジェクト: parsnick/steak
 /**
  * Publish a source file and/or pass to $next.
  *
  * @param Source $source
  * @param Closure $next
  * @param array $extensions
  * @return mixed
  */
 public function handle(Source $source, Closure $next, ...$extensions)
 {
     if ($this->isPublishable($source, $extensions)) {
         $view = new View($this->factory, $this->factory->getEngineFromPath($source->getPathname()), $this->files->get($source->getPathname()), $source->getPathname());
         $source->changeExtension(['.blade.php' => '.html'])->changeExtension(['.php' => '.html']);
         $this->write($source->getOutputPathname(), $view->render());
     }
     $next($source);
 }
コード例 #24
0
ファイル: TaskComposer.php プロジェクト: gitfreengers/larus
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $user = $this->user->find($this->user_auth->id);
     $alerts = $user->tasks()->outtime()->nodone()->get();
     $alertsCount = $alerts->count();
     $tasks = $user->tasks()->nodone()->get();
     $tasksCount = $tasks->count();
     $view->with(['tasksCount' => $tasksCount, 'tasks' => $tasks, 'alerts' => $alerts, 'alertsCount' => $alertsCount]);
 }
コード例 #25
0
 /**
  * @param $view
  *
  * @return mixed
  */
 public function compose(View $view)
 {
     $statuses = $this->status->all()->lists('name', 'id')->toArray();
     /*
      * Default selected None value
      */
     $statuses[null] = 'Select a Status';
     return $view->with('statuses', $statuses);
 }
コード例 #26
0
 /**
  * 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', ''));
 }
コード例 #27
0
ファイル: BaseController.php プロジェクト: GlobalsDD/admin
 /**
  * @param \Illuminate\View\View $view
  */
 protected function addViewDefaults(\Illuminate\View\View $view)
 {
     if ($title = $view->title) {
         $title .= ' – ';
     }
     $title .= $this->admin->title;
     $view->with('pageTitle', $title);
     $view->with('adminTitle', $this->admin->title);
 }
コード例 #28
0
 public function compose(View $view)
 {
     if (!Auth::check()) {
         $newConversationsCount = 0;
     } else {
         $newConversationsCount = account()->participations()->unread()->count();
     }
     $view->with(compact('newConversationsCount'));
 }
コード例 #29
0
 public function compose(View $view)
 {
     if (Auth::check()) {
         $auth = view('auth.authuser');
     } else {
         $auth = view('auth.noneauthuser');
     }
     $view->with('auth', $auth);
 }
コード例 #30
0
 /**
  * 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);
 }