本文整理汇总了PHP中Illuminate\View\View类的典型用法代码示例。如果您正苦于以下问题:PHP View类的具体用法?PHP View怎么用?PHP View使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了View类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: compose
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'));
}
开发者ID:aguila302,项目名称:oficios,代码行数:7,代码来源:LoadUsers.php
示例2: compose
/**
* 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());
}
}
开发者ID:digitlimit,项目名称:adminpanel,代码行数:13,代码来源:AdminpanelDashboardComposer.php
示例3: 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 (!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);
}
开发者ID:drickferreira,项目名称:rastreador,代码行数:33,代码来源:ViewCollector.php
示例4: compose
/**
* 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);
}
开发者ID:redknitin,项目名称:maintenance,代码行数:12,代码来源:MainLayoutComposer.php
示例5: compose
public function compose(View $view)
{
$mainMenu = $this->pages->with('translation')->whereHas('menuPositions', function ($query) {
$query->where('id', 2);
})->get()->toHierarchy();
$view->with('mainMenu', $mainMenu);
}
开发者ID:ilkinium,项目名称:btec.dev,代码行数:7,代码来源:NavigationComposer.php
示例6: compose
/**
* 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);
}
开发者ID:woolensculpture,项目名称:pulse,代码行数:13,代码来源:DJsViewComposer.php
示例7: 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
示例8: compose
/**
* 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);
}
开发者ID:mage2,项目名称:laravel-ecommerce,代码行数:13,代码来源:LayoutAppComposer.php
示例9: create
/**
* 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());
}
开发者ID:paul-schulleri,项目名称:laravel-googletagmanager,代码行数:12,代码来源:ScriptViewCreator.php
示例10: compose
/**
* 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);
}
开发者ID:mage2,项目名称:laravel-ecommerce,代码行数:13,代码来源:ProductBoxBasicComposer.php
示例11: prepare
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);
}
开发者ID:eddiePower,项目名称:laravelSites,代码行数:7,代码来源:BlogPostTemplate.php
示例12: compose
/**
* 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]);
}
开发者ID:gitfreengers,项目名称:larus,代码行数:13,代码来源:NotificationComposer.php
示例13: compose
/**
* 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);
}
开发者ID:jespersgaard,项目名称:tyloo,代码行数:13,代码来源:LoggedInUserViewComposer.php
示例14: setContent
/**
* 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);
}
开发者ID:kevindierkx,项目名称:uuid-namespace-manager,代码行数:12,代码来源:AbstractController.php
示例15: compose
/**
* 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);
}
开发者ID:woolensculpture,项目名称:pulse,代码行数:13,代码来源:ShowsViewComposer.php
示例16: render
/**
* 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();
}
}
开发者ID:marvinlabs,项目名称:baobab,代码行数:13,代码来源:Views.php
示例17: compose
/**
* 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);
}
开发者ID:ipunkt,项目名称:laravel-notify,代码行数:13,代码来源:ViewComposer.php
示例18: compose
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']);
}
开发者ID:chyupa,项目名称:Beta-Baroko,代码行数:8,代码来源:CartComposer.php
示例19: compose
/**
* 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);
}
开发者ID:josevh,项目名称:timegrid,代码行数:15,代码来源:UserHelpComposer.php
示例20: compose
/**
* 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);
}
开发者ID:mage2,项目名称:laravel-ecommerce,代码行数:14,代码来源:ProductBoxInventoryComposer.php
注:本文中的Illuminate\View\View类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论