當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Factory::make方法代碼示例

本文整理匯總了PHP中Illuminate\View\Factory::make方法的典型用法代碼示例。如果您正苦於以下問題:PHP Factory::make方法的具體用法?PHP Factory::make怎麽用?PHP Factory::make使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\View\Factory的用法示例。


在下文中一共展示了Factory::make方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: make

 /**
  * Make the view content.
  *
  * @param PageInterface $page
  */
 public function make(PageInterface $page)
 {
     $type = $page->getType();
     /* @var EditorFieldType $layout */
     $layout = $type->getFieldType('layout');
     $page->setContent($this->view->make($layout->getViewPath(), compact('page'))->render());
 }
開發者ID:visualturk,項目名稱:pages-module,代碼行數:12,代碼來源:PageContent.php

示例2: anyUpload

 public function anyUpload(InterfaceFileStorage $userFileStorage, AmqpWrapper $amqpWrapper, Server $server, UploadEntity $uploadEntity)
 {
     /* @var \App\Components\UserFileStorage $userFileStorage */
     $responseVariables = ['uploadStatus' => false, 'storageErrors' => [], 'uploadEntities' => []];
     if ($this->request->isMethod('post') && $this->request->hasFile('file') && $this->request->file('file')->isValid()) {
         $tmpDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'tmp-user-files-to-storage' . DIRECTORY_SEPARATOR;
         $tmpFilePath = $tmpDir . $this->request->file('file')->getClientOriginalName();
         $this->request->file('file')->move($tmpDir, $this->request->file('file')->getClientOriginalName());
         $userFileStorage->setValidationRules($this->config->get('storage.userfile.validation'));
         $newStorageFile = $userFileStorage->addFile($tmpFilePath);
         if ($newStorageFile && !$userFileStorage->hasErrors()) {
             /* @var \SplFileInfo $newStorageFile */
             // AMQP send $newfile, to servers
             foreach ($server->all() as $server) {
                 if (count($server->configs) > 0) {
                     foreach ($server->configs as $config) {
                         // Send server and file info to upload queue task
                         $amqpWrapper->sendMessage($this->config->get('amqp.queues.uploader.upload'), json_encode(['file' => $newStorageFile->getRealPath(), 'url' => $server->scheme . '://' . $config->auth . '@' . $server->host . '/' . trim($config->path, '\\/')]));
                     }
                 } else {
                     // The server has no configuration
                     $amqpWrapper->sendMessage($this->config->get('amqp.queues.uploader.upload'), json_encode(['file' => $newStorageFile->getRealPath(), 'url' => $server->scheme . '://' . $server->host]));
                 }
             }
             $responseVariables['uploadStatus'] = true;
         } else {
             $responseVariables['storageErrors'] = $userFileStorage->getErrors();
         }
         if ($this->request->ajax()) {
             return $this->response->json($responseVariables);
         }
     }
     $responseVariables['uploadEntities'] = $uploadEntity->limit(self::UPLOAD_ENTITIES_LIMIT)->orderBy('created_at', 'DESC')->get();
     return $this->view->make('upload.index', $responseVariables);
 }
開發者ID:ysaroka,項目名稱:uploader,代碼行數:35,代碼來源:UploadController.php

示例3: getReset

 public function getReset($token = null)
 {
     if (is_null($token)) {
         $this->application->abort(404);
     }
     return $this->view->make('UserManagement::password.reset')->with('token', $token);
 }
開發者ID:PhonemeCms,項目名稱:cms,代碼行數:7,代碼來源:RemindersController.php

示例4: template

 /**
  * Return an angular template partial.
  *
  * @param  \App\Http\Requests\Api\Angular\TemplateRequest  $request
  * @return \Illuminate\View\View
  */
 public function template(TemplateRequest $request)
 {
     $template = $request->get('template');
     if ($this->viewFactory->exists($template)) {
         return $this->viewFactory->make($template);
     }
     return $this->response()->errorNotFound();
 }
開發者ID:kevindierkx,項目名稱:uuid-namespace-manager,代碼行數:14,代碼來源:TemplatesController.php

示例5: getLogin

 /**
  * Displays the login form.
  */
 public function getLogin()
 {
     $viewConfig = $this->config->get('l4-lock::config.lock.views');
     if ($this->view->exists($viewConfig['foot-note'])) {
         $viewConfig['foot-note'] = $this->view->make($viewConfig['foot-note'])->render();
     }
     return $this->view->make($this->config->get('l4-lock::config.lock.views.login'), array('view' => $viewConfig))->render();
 }
開發者ID:codenamegary,項目名稱:l4-lock,代碼行數:11,代碼來源:LockController.php

示例6: parse

 /**
  * Parse some content.
  *
  * @param $content
  * @return string
  */
 public function parse($content)
 {
     if (!$this->files->isDirectory($path = storage_path('framework/views/asset'))) {
         $this->files->makeDirectory($path);
     }
     $this->files->put(storage_path('framework/views/asset/' . (($filename = md5($content)) . '.twig')), $content);
     return $this->views->make('root::storage/framework/views/asset/' . $filename)->render();
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:14,代碼來源:AssetParser.php

示例7: all

 /**
  * Returns all social sharing buttons.
  *
  * @return string
  */
 public function all()
 {
     $defaultButtons = Config::get('shareable::default_buttons', array());
     $buttons = array();
     $output = '';
     foreach ($defaultButtons as $button) {
         $buttons[] = call_user_func(array($this, $button));
     }
     return $this->view->make('shareable::all', array('buttons' => $buttons));
 }
開發者ID:mannysoft,項目名稱:shareable,代碼行數:15,代碼來源:Shareable.php

示例8: handle

 /**
  * Handle incoming requests.
  * @param Request $request
  * @param \Closure $next
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function handle($request, Closure $next)
 {
     if ($this->maintenance->isDownMode()) {
         if ($this->view->exists('errors.503')) {
             return new Response($this->view->make('errors.503'), 503);
         }
         return $this->app->abort(503, 'The application is down for maintenance.');
     }
     return $next($request);
 }
開發者ID:vluzrmos,項目名稱:lumen-maintenance-mode,代碼行數:16,代碼來源:MaintenanceModeMiddleware.php

示例9: composeMessage

 /**
  * Composes a message.
  *
  * @return \Illuminate\View\Factory
  */
 public function composeMessage()
 {
     // Attempts to make a view.
     // If a view can not be created; it is assumed that simple message is passed through.
     try {
         return $this->views->make($this->view, $this->data)->render();
     } catch (\InvalidArgumentException $e) {
         return $this->view;
     }
 }
開發者ID:simplesoftwareio,項目名稱:simple-sms,代碼行數:15,代碼來源:OutgoingMessage.php

示例10: compile

 /**
  * Generate the target file from a stub.
  *
  * @param $stub
  * @param $targetLocation
  */
 protected function compile($stub, $targetLocation)
 {
     $view = $this->view->make("generator.stubs::{$stub}", $this->context->toArray());
     $contents = "<?php\r\n\r\n" . $view->render();
     $targetDir = base_path('/SocialiteProviders/' . $this->context->nameStudlyCase());
     if (!$this->files->isDirectory($targetDir)) {
         $this->files->makeDirectory($targetDir, 0755, true, true);
         $this->files->makeDirectory($targetDir . '/src', 0755, true, true);
     }
     $this->files->put($targetDir . '/' . $targetLocation, $contents);
 }
開發者ID:socialiteproviders,項目名稱:generators,代碼行數:17,代碼來源:Compiler.php

示例11: renderContent

 /**
  * @return mixed
  */
 private function renderContent()
 {
     if (!$this->view->exists($this->template)) {
         $this->getFallBackTemplate();
     }
     return $this->view->make($this->template, $this->data);
 }
開發者ID:coandacms,項目名稱:coanda-core,代碼行數:10,代碼來源:PageRenderer.php

示例12: generate

 /**
  * Render weather widget.
  *
  * @param  array  $options
  * @return string
  */
 public function generate($options = array())
 {
     // Get options
     $options = array_merge($this->config['defaults'], $options);
     // Unify units
     $options['units'] = strtolower($options['units']);
     if (!in_array($options['units'], array('metric', 'imperial'))) {
         $options['units'] = 'imperial';
     }
     // Create cache key
     $cacheKey = 'Weather.' . md5(implode($options));
     // Check cache
     if ($this->config['cache'] && $this->cache->has($cacheKey)) {
         return $this->cache->get($cacheKey);
     }
     // Get current weather
     $current = $this->getWeather($options['query'], 0, $options['units'], 1);
     if ($current['cod'] !== 200) {
         return 'Unable to load weather';
     }
     // Get forecast
     $forecast = $this->getWeather($options['query'], $options['days'], $options['units']);
     // Render view
     $html = $this->view->make("{$this->config['views']}.{$options['style']}", array('current' => $current, 'forecast' => $forecast, 'units' => $options['units'], 'date' => $options['date']))->render();
     // Add to cache
     if ($this->config['cache']) {
         $this->cache->put($cacheKey, $html, $this->config['cache']);
     }
     return $html;
 }
開發者ID:torann,項目名稱:laravel-weather,代碼行數:36,代碼來源:Weather.php

示例13: make

 /**
  * Get the evaluated view contents for the given view.
  *
  * @param  string $view
  * @param  array $data
  * @param  array $mergeData
  * @return \Illuminate\Contracts\View\View
  */
 public function make($view, $data = [], $mergeData = [])
 {
     $normal_path = $this->normalizeName($view);
     $absolut_path = $this->finder->find($normal_path);
     $this->preparePath($absolut_path);
     $this->view = parent::make($view, $data, $mergeData);
     return $this->view;
 }
開發者ID:lava83,項目名稱:lavaproto,代碼行數:16,代碼來源:View.php

示例14: displayEditFields

 /**
  * Display fields on edit form screen.
  *
  * @param \stdClass $term The term object
  */
 public function displayEditFields($term)
 {
     $this->setNonce();
     foreach ($this->fields as $field) {
         $value = get_term_meta($term->term_id, $field['name'], true);
         $field['value'] = $this->getValue($term->term_id, $field, $value);
         echo $this->view->make('_themosisCoreTaxonomyEdit', ['field' => $field])->render();
     }
 }
開發者ID:themosis,項目名稱:framework,代碼行數:14,代碼來源:TaxonomyBuilder.php

示例15: input

 /**
  * We create the control input.
  *
  * @param       $type
  * @param       $name
  * @param null  $value
  * @param array $attributes
  * @param array $options
  * @return \Illuminate\Contracts\View\View
  */
 public function input($type, $name, $value = null, $attributes = [], $options = [])
 {
     $this->buildCssClasses($type, $attributes);
     $label = $this->buildLabel($name);
     $control = $this->buildControl($type, $name, $value, $attributes, $options);
     $error = $this->buildError($name);
     $icon = $this->buildIcon($attributes);
     $template = $this->buildTemplate($type, $attributes);
     return $this->view->make($template, compact('name', 'label', 'control', 'error', 'icon'));
 }
開發者ID:socieboy,項目名稱:forms,代碼行數:20,代碼來源:FieldBuilder.php


注:本文中的Illuminate\View\Factory::make方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。