本文整理汇总了PHP中Illuminate\Contracts\View\View类的典型用法代码示例。如果您正苦于以下问题:PHP View类的具体用法?PHP View怎么用?PHP View使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了View类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
// Retrieve all categories
$categories = Category::all();
// Bind them to view
$view->with('categories', $categories);
}
示例2: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$empresaslista = Empresa::orderBy('nombre', 'ASC')->lists('nombre', 'nombre');
$localidades = Localidad::orderBy('nombre', 'ASC')->lists('nombre', 'id');
$rubros = Rubro::orderBy('nombre', 'ASC')->lists('nombre', 'id');
$view->with('rubros', json_decode($rubros, true))->with('empresaslista', json_decode($empresaslista, true))->with('localidades', json_decode($localidades, true));
}
示例3: compose
/**
* Bind data to the view.
*
* @param \Illuminate\Contracts\View\View $view
*/
public function compose(View $view)
{
$view->withIssueCount(Issue::all()->count());
$view->withProjectCount(Project::all()->count());
$view->withGroupCount(Group::count());
$view->withMomentCount(Moment::all()->count());
}
示例4: compose
public function compose(View $view)
{
if ($view->getName() == 'frontend.property.compare_bar') {
$propertiesInComparison = PropertyCompareHelper::getCurrentList();
$view->with('propertiesInComparison', $propertiesInComparison);
}
}
示例5: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
//$notifacations = DB::table('notifacations')->where('userID', Auth::user()->id)->get();
$notifacationsCount = DB::table('notifacations')->where('userID', Auth::user()->id)->count();
//$view->with('notifacations', $notifacations);
$view->with('notifacationsCount', $notifacationsCount);
}
示例6: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
if (!Cache::get('popular_categories')) {
Cache::put('popular_categories', $this->categories->getPopular(), 60);
}
$view->with('popular_categories', Cache::get('popular_categories'));
}
示例7: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$menu = new Menu('ul', 'nav navbar-nav');
$menu->addItem(new MenuItem('#page-top', trans('pages.home_title'), 'li', 'hidden', 'page-scroll'));
$menu = content_filter('main_menu', $menu);
$view->with('main_menu', $menu);
}
示例8: compose
public function compose(View $view)
{
$categories = Cache::remember('categories', 1440, function () {
return Category::orderBy('name')->get();
});
$view->with(['user' => $this->auth->user(), 'categories' => $categories, 'guest' => !$this->auth->check()]);
}
示例9: compose
/**
* Index page view composer.
*
* @param \Illuminate\Contracts\View\View $view
*
* @return void
*/
public function compose(View $view)
{
$isEnabled = (bool) Setting::get('enable_subscribers', false);
$mailAddress = env('MAIL_ADDRESS', false);
$mailFrom = env('MAIL_NAME', false);
$view->withSubscribersEnabled($isEnabled && $mailAddress && $mailFrom);
}
示例10: create
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function create(View $view)
{
// request the Client translations
$clients = [Lang::get('labels.enter.Client')] + $this->clientController->lists('Client_Name');
//dd(__METHOD__."(".__LINE__.")",compact('clients'));
$view->with('clients', $clients);
}
示例11: create
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function create(View $view)
{
// request the UOM translations
$uoms = [Lang::get('labels.enter.UOM')] + $this->uomController->translate('Uom');
//dd(__METHOD__."(".__LINE__.")",compact('uoms'));
$view->with('uoms', $uoms);
}
示例12: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$productoslista = Producto::orderBy('nombre', 'ASC')->searchActivos()->lists('nombre', 'nombre');
$marcas = Marca::orderBy('nombre', 'ASC')->searchActivos()->lists('nombre', 'id');
$tipos = Tipoproducto::orderBy('nombreTipo', 'ASC')->lists('nombreTipo', 'id');
$view->with('marcas', json_decode($marcas, true))->with('tipos', json_decode($tipos, true))->with('productoslista', json_decode($productoslista, true));
}
示例13: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
if (!Cache::get('recent_posts')) {
Cache::put('recent_posts', $this->posts->getAll('published', null, 'published_at', 'desc', 5), 10);
}
$view->with('recent_posts', Cache::get('recent_posts'));
}
示例14: compose
/**
* Bind data to the view.
*
* @param View $view
*
* @return void
*/
public function compose(View $view)
{
if ($view->group_form_errors and $view->errors->any()) {
$view->nest('form_error_content', $view->bsb_pkg_ref . '::form.control.errors', ['errors' => $view->errors->all()]);
}
foreach ($view->groups as $name => &$input) {
if (is_array($input)) {
if (count(array_filter(array_keys($input), 'is_string'))) {
//The array contains named keys, generate inputs from these options
$view_name = $view->bsb_pkg_ref . '::input.' . (empty($input['type']) ? 'text' : $input['type']);
if (!view()->exists($view_name)) {
$view_name = $view->bsb_pkg_ref . '::input.' . 'text';
}
$input = view($view_name, array_merge(compact('name'), $input), $view->getData());
} else {
//The array contains html strings, display them together within a form-group
$input = view($view->bsb_pkg_ref . '::input.group', ['content' => implode("\n", $input)], $view->getData());
}
} elseif (!str_contains($input, '.form-group')) {
//The input is just a string of html, but it doesn't contain any .form-group element, so we'll wrap it in one
$input = view($view->bsb_pkg_ref . '::input.group', ['content' => $input], $view->getData());
}
}
//TODO: add form-horizontal and form-inline options
}
示例15: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$user = $this->user;
$travelOrderCount = 0;
$regularLeaveCount = 0;
$specialLeaveCount = 0;
if ($user->employee && $user->employee->canApproveRegularLeave()) {
$regularLeaveCount = $user->employee->regular_leave_recommending_approvals->merge($user->employee->regular_leave_approved_by)->count();
}
if ($user->employee && $user->employee->canApproveSpecialLeave()) {
$specialLeaveCount = $user->employee->special_leave_recommending_approvals->merge($user->employee->special_leave_approved_by)->count();
}
if ($user->isAdmin()) {
$regularLeaveCount = EmployeeLeave::approved()->count();
$specialLeaveCount = EmployeeSpecialLeave::approved()->count();
}
if ($user->employee && $user->employee->canApproveTravelOrder()) {
if ($user->isFinanceDirector()) {
$travelOrderCount = TravelOrder::recommended()->count();
} else {
$travelOrderCount = $user->employee->travel_order_recommending_approvals->merge($user->employee->travel_order_approved_by)->count();
}
}
$view->with(compact('user', 'regularLeaveCount', 'specialLeaveCount', 'travelOrderCount'));
}