当前位置: 首页>>代码示例>>PHP>>正文


PHP App::bind方法代码示例

本文整理汇总了PHP中App::bind方法的典型用法代码示例。如果您正苦于以下问题:PHP App::bind方法的具体用法?PHP App::bind怎么用?PHP App::bind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在App的用法示例。


在下文中一共展示了App::bind方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCancelBill

 /**
  * Отмена счёта
  */
 public function testCancelBill()
 {
     App::bind('FintechFab\\QiwiSdk\\Curl', function () {
         $reject = array('status' => 'rejected');
         $args = array(1, 'PATCH', $reject);
         $this->mock->shouldReceive('request')->withArgs($args)->andReturn((object) array('response' => (object) array('result_code' => 0)));
         return $this->mock;
     });
     $resp = $this->call('POST', Config::get('ff-qiwi-shop::testConfig.testUrl') . '/action/cancelBill', array('order_id' => '1'));
     $this->assertContains('Счёт отменён.', $resp->original['message']);
 }
开发者ID:fintech-fab,项目名称:qiwi-shop,代码行数:14,代码来源:ShopShowStatusAndCancelBillTest.php

示例2: registerBindings

 public function registerBindings()
 {
     $bindings = \Config::get('lablog::bindings');
     foreach ($bindings as $interface => $binding) {
         \App::bind($interface, $binding);
     }
 }
开发者ID:lablog,项目名称:lablog,代码行数:7,代码来源:LablogServiceProvider.php

示例3: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->package('leeb/jsonrpc');
     \App::bind('Leeb\\Jsonrpc\\Interfaces\\RequestInterface', function ($app, $data) {
         return new \Leeb\Jsonrpc\Request($data[0]);
     });
     \App::bind('Leeb\\Jsonrpc\\JsonrpcResponse', function ($app, $data) {
         return new \Leeb\Jsonrpc\JsonrpcResponse($data[0], $data[1], $data[2]);
     });
     \App::singleton('Leeb\\Jsonrpc\\Interfaces\\JsonrpcResponseBuilderInterface', 'Leeb\\Jsonrpc\\JsonrpcResponseBuilder');
     \App::bind('Leeb\\Jsonrpc\\RoutableRequest', function ($app, $data) {
         $resolver = \App::make('Leeb\\Jsonrpc\\Interfaces\\MethodResolverInterface');
         $response_builder = \App::make('Leeb\\Jsonrpc\\Interfaces\\JsonrpcResponseBuilderInterface');
         return new \Leeb\Jsonrpc\RoutableRequest($resolver, $response_builder, $data[0]);
     });
     \App::bind('Leeb\\Jsonrpc\\JsonrpcError', function ($app, $data) {
         return new \Leeb\Jsonrpc\JsonrpcError($data[0], $data[1], $data[2], $data[3]);
     });
     \App::bind('Leeb\\Jsonrpc\\RoutableNotification', function ($app, $data) {
         $resolver = \App::make('Leeb\\Jsonrpc\\Interfaces\\MethodResolverInterface');
         return new \Leeb\Jsonrpc\RoutableNotification($resolver, $data[0]);
     });
     \App::bind('Leeb\\Jsonrpc\\RoutableBatch', function ($app, $data) {
         return new \Leeb\Jsonrpc\RoutableBatch($data[0]);
     });
     \App::singleton('Leeb\\Jsonrpc\\Interfaces\\RouterInterface', 'Leeb\\Jsonrpc\\Router');
     \App::singleton('Leeb\\Jsonrpc\\Interfaces\\MethodResolverInterface', 'Leeb\\Jsonrpc\\MethodResolver');
     \App::singleton('Leeb\\Jsonrpc\\Interfaces\\JsonrpcConfigurationInterface', 'Leeb\\Jsonrpc\\JsonrpcConfiguration');
     \App::singleton('Leeb\\Jsonrpc\\Interfaces\\RequestValidatorInterface', 'Leeb\\Jsonrpc\\RequestValidator');
     \App::singleton('Leeb\\Jsonrpc\\Interfaces\\RawRequestInterpreterInterface', 'Leeb\\Jsonrpc\\RawRequestInterpreter');
 }
开发者ID:emayk,项目名称:jsonrpc,代码行数:36,代码来源:JsonrpcServiceProvider.php

示例4: setUp

 public function setUp()
 {
     parent::setUp();
     \App::bind("App\\Repositories\\RecipeRepositoryInterface", "App\\Tests\\StubRepositories\\RecipeRepository");
     \App::bind("App\\Presenter\\FeedInterface", "App\\Presenter\\Feed");
     $this->controller = new FeedController(\App::make("App\\Presenter\\FeedInterface"), \App::make("App\\Repositories\\RecipeRepositoryInterface"));
 }
开发者ID:k-kurikuri,项目名称:Laravel.JpRecipe,代码行数:7,代码来源:FeedControllerTest.php

示例5: boot

 public function boot()
 {
     App::bind('form', function () {
         return new TwanooLib\FormPlus();
     });
     parent::boot();
 }
开发者ID:TwanoO67,项目名称:CRM_Patientele,代码行数:7,代码来源:TwanooHtmlServiceProvider.php

示例6: register

 public function register()
 {
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\DefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\DefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\CsvDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\CsvDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\TabularColumnsRepositoryInterface', 'Tdt\\Core\\Repositories\\TabularColumnsRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\GeoPropertyRepositoryInterface', 'Tdt\\Core\\Repositories\\GeoPropertyRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\XlsDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\XlsDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\ShpDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\ShpDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\JsonDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\JsonDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\XmlDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\XmlDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\SparqlDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\SparqlDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\InstalledDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\InstalledDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\LanguageRepositoryInterface', 'Tdt\\Core\\Repositories\\LanguageRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\LicenseRepositoryInterface', 'Tdt\\Core\\Repositories\\LicenseRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\OntologyRepositoryInterface', 'Tdt\\Core\\Repositories\\OntologyRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\RdfDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\RdfDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\JsonldDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\JsonldDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\DcatRepositoryInterface', 'Tdt\\Core\\Repositories\\DcatRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\SettingsRepositoryInterface', 'Tdt\\Core\\Repositories\\SettingsRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\ThemeRepositoryInterface', 'Tdt\\Core\\Repositories\\ThemeRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\MysqlDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\MysqlDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\MongoDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\MongoDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\ElasticsearchDefinitionRepositoryInterface', 'Tdt\\Core\\Repositories\\ElasticsearchDefinitionRepository');
     \App::bind('Tdt\\Core\\Repositories\\Interfaces\\GeoprojectionRepositoryInterface', 'Tdt\\Core\\Repositories\\GeoprojectionRepository');
 }
开发者ID:jalbertbowden,项目名称:core,代码行数:25,代码来源:DbServiceProvider.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     \App::bind("App\\Repositories\\SectionRepositoryInterface", "App\\Tests\\StubRepositories\\SectionRepository");
     \App::bind("App\\Repositories\\CategoryRepositoryInterface", "App\\Tests\\StubRepositories\\CategoryRepository");
     \App::bind("App\\Repositories\\RecipeRepositoryInterface", "App\\Tests\\StubRepositories\\RecipeRepository");
     $this->controller = new RecipeController(\App::make("App\\Repositories\\SectionRepositoryInterface"), \App::make("App\\Repositories\\CategoryRepositoryInterface"), \App::make("App\\Repositories\\RecipeRepositoryInterface"), new Hal());
 }
开发者ID:k-kurikuri,项目名称:Laravel.JpRecipe,代码行数:8,代码来源:RecipeControllerTest.php

示例8: boot

 public function boot()
 {
     $this->package('dazza76/Laravel4Secureurl');
     \App::bind('url', function () {
         return new SecureUrlGenerator(\App::make('router')->getRoutes(), \App::make('request'));
     });
     parent::boot();
 }
开发者ID:dazza76,项目名称:laravel4secureurl,代码行数:8,代码来源:Laravel4SecureURLServiceProvider.php

示例9: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     \App::bind('GoogleAPIWrapper', function () {
         return new GoogleAPIWrapperClass();
     });
     $this->app->make('Brognara\\GoogleAPIWrapper\\GoogleAPIWrapperClass');
     //include __DIR__.'/routes.php';
 }
开发者ID:lucabro81,项目名称:edutube,代码行数:13,代码来源:GoogleAPIWrapperServiceProvider.php

示例10: __construct

 public function __construct()
 {
     App::bind('Pusher', function ($app) {
         $keys = $app['config']->get('services.pusher');
         return new Pusher($keys['public'], $keys['secret'], $keys['app_id']);
     });
     $this->beforeFilter('csrf', array('on' => 'post'));
 }
开发者ID:prateekk16,项目名称:wasdbox,代码行数:8,代码来源:UserController.php

示例11: register

 public function register()
 {
     foreach (glob(app_path() . '/Expert/Helpers/*.php') as $filename) {
         require_once $filename;
     }
     \App::bind('general', function () {
         return new General();
     });
 }
开发者ID:KritaMaharjan,项目名称:expert,代码行数:9,代码来源:HelperServiceProvider.php

示例12: register

 public function register()
 {
     \App::bind('reader', function () {
         return new Reader();
     });
     \App::bind('writer', function () {
         return new Writer();
     });
 }
开发者ID:cichowski,项目名称:csv,代码行数:9,代码来源:CsvServiceProvider.php

示例13: register

 /**
  * Register any application services.
  *
  * This service provider is a great spot to register your various container
  * bindings with the application. As you can see, we are registering our
  * "Registrar" implementation here. You can add your own bindings too!
  *
  * @return void
  */
 public function register()
 {
     \App::bind('markdown', function () {
         $parser = new \cebe\markdown\GithubMarkdown();
         $parser->html5 = true;
         $parser->keepListStartNumber = true;
         return $parser;
     });
 }
开发者ID:rafaelvieiras,项目名称:connect,代码行数:18,代码来源:MarkdownServiceProvider.php

示例14: register

 public function register()
 {
     \App::bind('MindOfMicah\\LaravelDatatables\\Datatable', function () {
         return new \MindOfMicah\LaravelDatatables\Datatable();
     });
     \App::bind('mindofmicah.datatables', function () {
         return new \MindOfMicah\LaravelDatatables\Datatable();
     });
 }
开发者ID:mindofmicah,项目名称:laravel-datatables,代码行数:9,代码来源:DatatableProvider.php

示例15: register

 public function register()
 {
     App::bind('resource.controller', function () {
         return new ControllerGenerator();
     });
     App::bind('resource.route', function () {
         return new RouteGenerator();
     });
 }
开发者ID:impleri,项目名称:laravel-resource,代码行数:9,代码来源:ResourceServiceProvider.php


注:本文中的App::bind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。