作者:Erbeno
项目:laravel-blo
/**
* 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);
}
作者:desarrollo-para-triunfadore
项目:laautentic
/**
* 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));
}
作者:xiaobail
项目:Gitami
/**
* 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());
}
作者:yohanes198
项目:gopro
public function compose(View $view)
{
if ($view->getName() == 'frontend.property.compare_bar') {
$propertiesInComparison = PropertyCompareHelper::getCurrentList();
$view->with('propertiesInComparison', $propertiesInComparison);
}
}
作者:deferdi
项目:twee
/**
* 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);
}
作者:ambarsetyawa
项目:brewsk
/**
* 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'));
}
作者:linhntai
项目:katnis
/**
* 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);
}
作者:net-shel
项目:socialsyn
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()]);
}
作者:practic
项目:Cache
/**
* 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);
}
作者:pneal-vita
项目:vital4.
/**
* 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);
}
作者:pneal-vita
项目:vital4.
/**
* 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);
}
作者:desarrollo-para-triunfadore
项目:laautentic
/**
* 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));
}
作者:ambarsetyawa
项目:brewsk
/**
* 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'));
}
作者:fewagenc
项目:twbs-blad
/**
* 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
}
作者:rosemalejoh
项目:dnsc-hri
/**
* 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'));
}
作者:jackmolna
项目:glit_websit
public function compose(View $view)
{
$program_array = $this->programRepo->getDropDownArray();
unset($program_array['Cosmetology Operator']);
unset($program_array['Cosmetology Teacher']);
$view->with('programs', $program_array);
}
作者:hechoenlarave
项目:jarvis-foundatio
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
if (!Auth::guest()) {
$n = Notification::byUser(Auth::user())->unread()->get();
$view->with('notifications', ['count' => $n->count(), 'notifications' => $n]);
}
}
作者:lava8
项目:lavaprot
/**
*
* return the path of the actually view
*
* @return string
* @throws ViewException
*/
public function getPath()
{
if (is_null($this->view)) {
throw new ViewException('View is not defined');
}
return $this->view->getPath();
}
作者:Erbeno
项目:laravel-blo
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
// Retrieve all pages
$pages = Page::all();
// Bind them to view
$view->with('pages', $pages);
}
作者:evesea
项目:we
/**
* Bind data to the view.
*
* @param View $view
*
* @return void
*/
public function compose(View $view)
{
$summary = $this->getCharacterInformation($this->request->character_id);
$characters = $this->getCharactersOnApiKey($summary->keyID);
$view->with('summary', $summary);
$view->with('characters', $characters);
}