本文整理汇总了PHP中view函数的典型用法代码示例。如果您正苦于以下问题:PHP view函数的具体用法?PHP view怎么用?PHP view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了view函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pending_leads_by_source
public function pending_leads_by_source()
{
$data_sources = $this->reporting->pendingLeadsBySource()->lists('label');
$data_count = $this->reporting->pendingLeadsBySource()->lists('data');
$leads = $this->reporting->allPendingBySource();
return view('admin.leadrouter.pending_leads_by_source', compact('leads', 'data_sources', 'data_count'));
}
开发者ID:jdelise,项目名称:career_site,代码行数:7,代码来源:ReportingController.php
示例2: getValidateToken
/**
*
* @return \Illuminate\Http\Response
*/
public function getValidateToken()
{
if (session('2fa:user:id')) {
return view('2fa/validate');
}
return redirect('login');
}
开发者ID:cwt137,项目名称:google-laravel-2fa,代码行数:11,代码来源:AuthController.php
示例3: dashboard
/**
* Page Acceuil
*/
public function dashboard()
{
// $redirectUrl = $response->links[1]->href;
$nbacteurs = Actors::count();
$nbcommentaires = Comments::count();
$nbmovies = Movies::count();
$nbseances = Sessions::count();
$actor = new Actors();
// Je récpere mon modèle
$comment = new Comments();
// Je récpere mon modèle
$movie = new Movies();
// Je récpere mon modèle
$session = new Sessions();
// Je récpere mon modèle
$user = new User();
// Je récpere mon modèle
$avgacteurs = $actor->getAvgActors();
$avgnotecommentaire = $comment->getAvgNote();
$avgnotepresse = $movie->getAvgNotePresse();
$avghour = $session->getAvgHourDate();
$seances = $session->getNextSession();
$users = $user->getLastUsers();
/*
$seances = Sessions::where("date_session", ">", DB::raw("NOW()"))
->take(15)->get();
*/
return view('Main/dashboard', ['avgnotecommentaire' => $avgnotecommentaire->avgnote, 'avgnotepresse' => $avgnotepresse->avgpress, 'avgacteurs' => $avgacteurs->age, 'avghour' => $avghour->avghour, 'nbacteurs' => $nbacteurs, 'nbcommentaires' => $nbcommentaires, 'nbmovies' => $nbmovies, 'nbseances' => $nbseances, 'seances' => $seances, 'users' => $users]);
}
开发者ID:unpetitlu,项目名称:laravelcinema,代码行数:32,代码来源:MainController.php
示例4: index
/**
* @param string $model The model to list.
* @return mixed
*/
public function index(Request $request, $model)
{
if (!Auth::check()) {
return response("Unauthorised", 401);
}
$user = Auth::user();
if ($user->cannot('administrate')) {
return response("Unauthorised", 401);
}
$class = $this->getModel($model);
if (is_null($class)) {
return response("No items found for this model {$model}", 404);
}
$pagination_enabled = config('crudapi.pagination.enabled');
$perPage = config('crudapi.pagination.perPage');
if ($pagination_enabled) {
$items = $class->paginate($perPage);
} else {
$items = $class->all();
}
$fields = $class->getFillable();
$data = $this->buildData();
$data['items'] = $items;
$data['model'] = $model;
$data['fields'] = $fields;
$data['uiframework'] = config('crudapi.framework', 'bs3');
$data['timestamps'] = config('crudapi.admin.showTimestamps', false);
$data['show_ids'] = config('crudapi.admin.showIds', false);
return view('crudapi::admin.index', $data);
}
开发者ID:azhany,项目名称:crud-api,代码行数:34,代码来源:AdminController.php
示例5: render
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if ($e instanceof HttpException) {
return view('errors/404');
}
return parent::render($request, $e);
}
开发者ID:ssddanbrown,项目名称:BookStack-Site,代码行数:14,代码来源:Handler.php
示例6: viewVehicle
public function viewVehicle(Request $request)
{
$user = $request->session()->get('user');
//Gets buildings
$vehicles = vehicleModel::where('vehicleOwnerID', '=', $user[0]->id)->get();
return view('pages.vehicleOwnerVehicles', array('user' => $user, 'vehicles' => $vehicles));
}
开发者ID:manvimal,项目名称:Logiify,代码行数:7,代码来源:vehicleController.php
示例7: index
/**
* Return an index of archived posts.
*
* @param PostRepositoryInterface $posts
* @param $year
* @param null $month
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index(PostRepositoryInterface $posts, $year, $month = null)
{
$this->dispatch(new AddPostsBreadcrumb());
$this->dispatch(new AddArchiveBreadcrumb());
$posts = $posts->findManyByDate($year, $month);
return view('anomaly.module.posts::archive/index', compact('year', 'month', 'posts'));
}
开发者ID:jacksun101,项目名称:posts-module,代码行数:15,代码来源:ArchiveController.php
示例8: store
public function store(Request $request)
{
$postCategory = $request->get('postCategory');
if ($postCategory == "create") {
$moduleDetails = BaseHelpers::createModule($request->file('file'));
$module = ModvelModule::create(['name' => $moduleDetails["name"], 'description' => $moduleDetails["description"], 'category' => $moduleDetails["category"], 'customer' => $moduleDetails["customer"], 'icon' => $moduleDetails["icon"], 'version' => $moduleDetails["version"], 'adminDisplayName' => $moduleDetails["adminDisplayName"], 'adminVisible' => $moduleDetails["adminVisible"], 'adminDisplayOrder' => 0, 'displayName' => $moduleDetails["displayName"], 'displayVisible' => $moduleDetails["displayVisible"], 'displayOrder' => $moduleDetails["displayOrder"]]);
foreach ($moduleDetails as $k => $v) {
if (is_array($v)) {
if ($v != []) {
foreach ($v as $key => $value) {
$detail = new ModvelModuleDetail();
$detail->moduleId = $module->id;
$detail->category = $k;
$detail->key = $key;
$detail->value = $value;
$detail->save();
}
}
}
}
$datas = ModvelModule::get();
return view("Modvel::admin." . $this->theme . ".modules.index")->with('datas', $datas)->with('headName', $this->headName);
}
$datas = ModvelModule::get();
return view("Modvel::admin." . $this->theme . ".modules.index")->with('datas', $datas)->with('headName', $this->headName);
}
开发者ID:furkankadioglu,项目名称:modvel,代码行数:26,代码来源:ModvelModulesAdminController.php
示例9: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
// Validate form
$this->validate($request, ['user_quantity' => 'required|integer|between:1,100']);
// Assign variables
$form_array = $request->input('form_array', array());
$user_quantity = $request->input('user_quantity');
// Generate Fake User Data
$faker = Factory::create('en_US');
$payload = array();
$deposit_address = in_array('address', $form_array);
$deposit_phone = in_array('phone', $form_array);
$deposit_birthdate = in_array('birthdate', $form_array);
for ($i = 0; $i < $user_quantity; $i++) {
$individual = array();
$individual[] = $faker->name;
if ($deposit_address) {
$individual[] = $faker->address;
}
if ($deposit_phone) {
$individual[] = $faker->phoneNumber;
}
if ($deposit_birthdate) {
$individual[] = $faker->date($format = 'Y-m-d', $max = 'now');
}
// Append to payload array
$payload[] = $individual;
}
// Push data to view and return view
return view('results', ['payload' => $payload, 'source' => 'fake-user', 'title' => 'Fake User Generator']);
}
开发者ID:sietekk,项目名称:cscie15.project3,代码行数:37,代码来源:FakeUserController.php
示例10: index
/**
* Show the application welcome screen to the user.
*
* @return Response
*/
public function index()
{
$gallery = Page::where('slug', '=', 'gallery')->first();
$images = explode(',', $gallery->content);
$images = array_slice($images, 0, 16);
return view('frontend.index', ['images' => $images]);
}
开发者ID:aysenli,项目名称:laravel5-backend,代码行数:12,代码来源:WelcomeController.php
示例11: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$Beatles = ['John', 'Paul', 'George', 'Ringo'];
//alert()->overlay('Listen', 'I hear Beatle music!', 'success');
//alert()->error('Problem', 'Cannot hear');
return view('test.index', compact('Beatles'));
}
开发者ID:vihugarcia,项目名称:vhglaraboot,代码行数:12,代码来源:TestController.php
示例12: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$suppliers = Supplier::orderBy('name')->get();
$employees = Employee::orderBy('firstname')->get();
$customers = Customer::orderBy('name')->get();
return view('inventory.home', compact(['suppliers', 'employees', 'customers']));
}
开发者ID:MangTomas23,项目名称:tgm,代码行数:12,代码来源:InventoryController.php
示例13: index
public function index(WpApiContract $wp_client)
{
$posts = $wp_client->getPosts();
$posts = json_decode($posts);
//dd($posts);
return view('layouts.index', compact('posts'));
}
开发者ID:jedifunk,项目名称:jbfj-laravel-wp-api,代码行数:7,代码来源:WpController.php
示例14: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
if ($id) {
return view('admin/sku/color/modify')->withColor(PhoneColor::find($id));
}
return redirect()->back();
}
开发者ID:pinse98,项目名称:mitao,代码行数:13,代码来源:AdminColorController.php
示例15: postLogin
public function postLogin(Request $request)
{
$this->validate($request, ['username' => 'required', 'password' => 'required']);
$credentials = $request->only('username', 'password', 'active');
$employee = Employee::where('username', $credentials['username'])->where('active', true)->first();
if ($employee != null && password_verify($credentials['password'], $employee->password)) {
if (!$employee->isadmin) {
if (getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} else {
$ip = getenv('REMOTE_ADDR');
}
$host = gethostbyaddr($ip);
$ipAddress = 'Address : ' . $ip . ' Host : ' . $host;
$count = Ipaddress::where('ip', $ip)->count();
$today = date("Y-m-d");
if ($count == 0 || $employee->loginstartdate == null || $today < date('Y-m-d', strtotime($employee->loginstartdate)) || $employee->loginenddate != null && $today > date('Y-m-d', strtotime($employee->loginenddate))) {
return view('errors.permissiondenied', ['ipAddress' => $ipAddress]);
}
if ($employee->branchid == null) {
return redirect($this->loginPath())->withInput($request->only('username', 'remember'))->withErrors(['username' => 'บัญชีเข้าใช้งานของคุณยังไม่ได้ผูกกับสาขา โปรดติดต่อหัวหน้า หรือผู้ดูแล']);
}
}
if ($this->auth->attempt($credentials, $request->has('remember'))) {
return redirect()->intended($this->redirectPath());
}
} else {
return redirect($this->loginPath())->withInput($request->only('username', 'remember'))->withErrors(['username' => $this->getFailedLoginMessage()]);
}
}
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:30,代码来源:AuthController.php
示例16: pepsi
public function pepsi(Request $request)
{
/*
$components = ['062BFFD1637011E5B83800FF59FBB323',
'063278FF637011E5B83800FF59FBB323',
'0631FF85637011E5B83800FF59FBB323',
'062C796C637011E5B83800FF59FBB323',
'0615D0AA637011E5B83800FF59FBB323',
'06163FD0637011E5B83800FF59FBB323'];
*/
$components = ['08BA6275637011E5B83800FF59FBB323', '08BABBC7637011E5B83800FF59FBB323', '08BA0B96637011E5B83800FF59FBB323', '061BC1EB637011E5B83800FF59FBB323', '06229D04637011E5B83800FF59FBB323', '06232D26637011E5B83800FF59FBB323', '08BD2EDD637011E5B83800FF59FBB323', '08BD8844637011E5B83800FF59FBB323', '08BDE48E637011E5B83800FF59FBB323', '08BE401B637011E5B83800FF59FBB323', '08BE97FC637011E5B83800FF59FBB323', '08BEEB6C637011E5B83800FF59FBB323'];
$data = [];
$branches = \App\Models\Branch::orderBy('code')->get();
if ($request->input('year') != '' && $request->input('branchid') != '') {
foreach ($components as $key => $value) {
$date = \Carbon\Carbon::parse($request->input('year') . '-01-01');
$results = \App\Models\Purchase2::select(DB::raw('date, SUM(qty) AS qty, SUM(tcost) AS tcost'))->where('componentid', $value)->where('branchid', $request->input('branchid'))->where(DB::raw('YEAR(date)'), $request->input('year'))->groupBy(DB::raw('YEAR(date)'))->groupBy(DB::raw('MONTH(date)'))->get();
for ($i = 0; $i < 12; $i++) {
$filtered = $results->filter(function ($item) use($date) {
return $item->date->format('Y-m') == $date->format('Y-m') ? $item : null;
});
$data[$key][$date->format('Y-m-d')] = $filtered->first();
$date->addMonth();
}
}
}
if ($request->input('data') != '') {
return $data;
}
return view('blank')->with('branches', $branches)->with('data', $data);
}
开发者ID:jrsalunga,项目名称:gi-cashier,代码行数:31,代码来源:DashboardController.php
示例17: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
if (Schema::hasTable('categories')) {
$categories = Category::getAllFromCache();
view()->share('categories', $categories);
}
}
开发者ID:mikolajszczepanski,项目名称:NuPtr,代码行数:12,代码来源:CategoryServiceProvider.php
示例18: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
/*$user = Auth::user();
$facebookData = \app\Http\Library\DataFetcher::getTwitterData($user -> is_logged_in_twitter, $user -> token_twitter, $user -> token_secret_twitter);
$twitterData = null;
$instagramData = null;
if ($user -> is_logged_in_facebook)
{
//$facebookData = array(0 => "facebook not set up yet");
}
if ($user -> is_logged_in_instagram)
{
$instagramToken = $user -> token_instagram;
Instagram::setAccessToken($instagramToken);
$instagramData = Instagram::getUserFeed(100) -> data;
}
//return "hello world";
$temptotal = array_merge((array)$facebookData, (array)$twitterData, (array)$instagramData);
usort($temptotal, array($this, "cmp"));
return $temptotal; */
$fetcher = new DataFetcher();
$data = $fetcher->fetchAllData();
return view('pages.twitter')->with('socialObjects', $data);
}
开发者ID:philsawyer16,项目名称:philiphsawyer.dev,代码行数:34,代码来源:DataController.php
示例19: getReset
/**
* Display the password reset view for the given token.
*
* @param string $token
* @return \Illuminate\Http\Response
*/
public function getReset($token = null)
{
if (is_null($token)) {
throw new NotFoundHttpException();
}
return view('auth.password.reset')->with('token', $token);
}
开发者ID:minors,项目名称:laravel-spark,代码行数:13,代码来源:PasswordController.php
示例20: index
/**
* Init the index view with the current
* average rate data stored in the db.
*
* @return Response
*/
public function index()
{
// Select the rates of the year 2015.
// NOTE: Just for the purpose of the exercise,
// would be nicer to provide all the results available
// grouped accordingly
$rates = Db::table('monthly_rates')->select('currency_from', 'currency_to', 'month', 'avg_rate')->where('year', 2015)->orderBy('currency_from')->orderBy('currency_to')->get();
// Initialize the messages array as charts.js expects it
if (empty($rates)) {
$messages = [[]];
} else {
$messages = [];
}
$monthRates = [];
$totRates = count($rates);
// Aggregate the messages as an array
// currencyfrom_currencyto => [1 => avg_rate, 2 => ...]
// where the inner array index corresponds to a month
for ($i = 0; $i < $totRates; $i++) {
$rate = $rates[$i];
$monthRates[$rate->month] = $rate->avg_rate;
if ($i == $totRates - 1) {
$key = $rate->currency_from . '-' . $rate->currency_to;
$messages[$key] = $monthRates;
} elseif ($rate->currency_from != $rates[$i + 1]->currency_from || $rate->currency_to != $rates[$i + 1]->currency_to) {
// Build the array key and store the data
$key = $rate->currency_from . '-' . $rate->currency_to;
$messages[$key] = $monthRates;
$monthRates = [];
}
}
return view('socket', compact('messages'));
}
开发者ID:staribelli,项目名称:market-trade-processor,代码行数:39,代码来源:CurrencymessageController.php
注:本文中的view函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论