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


PHP Controller::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * Create a new controller instance.
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $this->page['title'] = trans('admin.manager_menu');
     $this->model = new Menu();
     $this->lang = Lang::getLocale();
 }
開發者ID:blackorwhite1233,項目名稱:laravel5,代碼行數:12,代碼來源:MenuController.php

示例2: __construct

 public function __construct(PartRepositoryEloquent $partRepo, TireSensorRepositoryEloquent $tireSensorRepo)
 {
     parent::__construct();
     $this->middleware('auth');
     $this->partRepo = $partRepo;
     $this->tireSensorRepo = $tireSensorRepo;
 }
開發者ID:alientronics,項目名稱:fleetany-web,代碼行數:7,代碼來源:TireController.php

示例3: __construct

 /**
  * @param DbBookRepository $bookRepository
  * @param AjaxBookRepository $ajaxRepository
  */
 public function __construct(DbBookRepository $bookRepository, AjaxBookRepository $ajaxRepository)
 {
     $this->middleware('acl:create_book', ['only' => ['index', 'create', 'store', 'edit', 'update', 'ajaxSearchISBN']]);
     $this->book = $bookRepository;
     $this->ajax = $ajaxRepository;
     parent::__construct();
 }
開發者ID:nicsmyrn,項目名稱:library,代碼行數:11,代碼來源:BooksController.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     $this->middleware('auth', ['except' => ['index', 'show']]);
     $user = Sentinel::getUser();
     PostService::setUser($user);
 }
開發者ID:joonas-yoon,項目名稱:acm-oj,代碼行數:7,代碼來源:PostsController.php

示例5: __construct

 /**
  * Create a new authentication controller instance.
  *
  * @param  \Illuminate\Contracts\Auth\Guard  $auth
  * @param  \Illuminate\Contracts\Auth\Registrar  $registrar
  * @return void
  */
 public function __construct(Registrar $registrar, Auth $auth, Socialite $socialite, SocialUserRepository $socialUsers)
 {
     parent::__construct();
     $this->resolve();
     $this->loginPath = route('auth.login');
     $this->middleware('guest', ['except' => 'getLogout']);
 }
開發者ID:nich-mctishe,項目名稱:laravel-framework,代碼行數:14,代碼來源:AuthController.php

示例6: __construct

 public function __construct(ProfileService $profileService, UserRepo $userRepo, SaleRepo $saleRepo)
 {
     $this->profileService = $profileService;
     $this->userRepo = $userRepo;
     $this->saleRepo = $saleRepo;
     parent::__construct();
 }
開發者ID:arjayads,項目名稱:green-tracker,代碼行數:7,代碼來源:ProfileController.php

示例7: __construct

 /**
  * Create a new password controller instance.
  *
  * @param Guard           $auth
  * @param  PasswordBroker $passwords
  */
 public function __construct(Guard $auth, PasswordBroker $passwords)
 {
     $this->auth = $auth;
     $this->passwords = $passwords;
     $this->middleware('guest');
     parent::__construct();
 }
開發者ID:valdinei,項目名稱:rest,代碼行數:13,代碼來源:PasswordController.php

示例8:

 function __construct()
 {
     parent::__construct();
     if (!$this->isAdmin($this->getLoggedInUser())) {
         throw new \Exception("Not allowed, only admin has access", 401);
     }
 }
開發者ID:thabung,項目名稱:serveaseme,代碼行數:7,代碼來源:AdminController.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     if (\Session::has('admin.username')) {
         $this->userid = \Session::get('admin.adminid');
     }
 }
開發者ID:946493655,項目名稱:culture,代碼行數:7,代碼來源:BaseController.php

示例10: __construct

 /**
  * FlyersController constructor.
  */
 public function __construct()
 {
     // everybody must be authenticated to access the methods
     // except for the show method
     $this->middleware('auth', ['except' => ['show']]);
     parent::__construct();
 }
開發者ID:anruence,項目名稱:project-flyer,代碼行數:10,代碼來源:FlyersController.php

示例11: __construct

 public function __construct(UserRepository $user, RoleRepository $role, PermissionRepository $perms)
 {
     parent::__construct();
     $this->user = $user;
     $this->role = $role;
     $this->permission = $perms;
 }
開發者ID:vnzacky,項目名稱:dog,代碼行數:7,代碼來源:UserController.php

示例12: __construct

 /**
  * Constructor.
  *
  * @param type \Litecms\PriceList\Interfaces\PriceListRepositoryInterface $pricelist
  *
  * @return type
  */
 public function __construct(PriceListRepositoryInterface $pricelist)
 {
     $this->repository = $pricelist;
     $this->middleware('web');
     $this->setupTheme(config('theme.themes.public.theme'), config('theme.themes.public.layout'));
     parent::__construct();
 }
開發者ID:litecms,項目名稱:pricelist,代碼行數:14,代碼來源:PriceListController.php

示例13: __construct

 public function __construct()
 {
     $this->middleware('auth', ['only' => ['getInvoice', 'postUpdateCart', 'postAddToCart', 'postCheckout', 'postNewAddress', 'postUpdateAddress', 'postUpdateCart', 'putRequestNotification']]);
     $this->middleware('check-user-restricted', ['only' => ['getInvoice', 'postUpdateCart', 'postAddToCart', 'postCheckout', 'postNewAddress', 'postUpdateAddress', 'postUpdateCart', 'putRequestNotification']]);
     $this->middleware('verify-user', ['only' => ['getInvoice', 'getCheckout', 'postCheckout', 'postUpdateAddress']]);
     return parent::__construct();
 }
開發者ID:ameliaikeda,項目名稱:osu-web,代碼行數:7,代碼來源:StoreController.php

示例14: __construct

 public function __construct()
 {
     $this->middleware('auth', ['except' => ['index', 'show']]);
     $this->middleware('author:article', ['except' => ['index', 'show', 'create']]);
     view()->share('allTags', Tag::with('articles')->get());
     parent::__construct();
 }
開發者ID:gabrieljo,項目名稱:l5essential,代碼行數:7,代碼來源:ArticlesController.php

示例15: __construct

 public function __construct()
 {
     $this->middleware('auth', ['only' => ['store']]);
     // $this->middleware('cachebefore', ['only' => ['show', 'showAjax']]);
     // $this->middleware('cacheafter', ['only' => ['show', 'showAjax']]);
     parent::__construct();
 }
開發者ID:sidis405,項目名稱:filtr,代碼行數:7,代碼來源:LinksController.php


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