Пример #1
0
 /**
  * Get the registered component.
  *
  * @return string
  */
 protected static function getFacadeAccessor()
 {
     if (!static::$app) {
         static::$app = FormerServiceProvider::make();
     }
     return 'former';
 }
 /**
  * Register the HTML builder instance.
  */
 public function register()
 {
     parent::register();
     $this->app['former.dispatcher']->addRepository('Tinyissue\\Form\\Former\\Fields\\');
     // Stop it from rendering field name into label
     \Former::setOption('automatic_label', false);
     \Former::setOption('TwitterBootstrap3.labelWidths', array('large' => 2, 'small' => 3));
 }
Пример #3
0
 /**
  * Build the IoC Container for the tests
  */
 public function setUp()
 {
     if (!static::$appCache) {
         $this->app = FormerServiceProvider::make();
         // Setup Illuminate
         $this->mockSession();
         $this->mockTranslator();
         $this->mockUrl();
         $this->mockValidator();
         static::$appCache = $this->app;
     }
     $this->app = static::$appCache;
     $this->mockConfig();
     $this->mockRequest();
 }
Пример #4
0
 /**
  * Static alias for binding classes to a given Container
  *
  * @param Container $app
  *
  * @return Container
  */
 public static function make(Container $app = null)
 {
     // If no Container, create one
     if (!$app) {
         $app = new Container();
     }
     // Call the class binders
     $serviceProvider = new static($app);
     $app = FormerServiceProvider::make($app);
     $app = $serviceProvider->bindCoreClasses($app);
     $app = $serviceProvider->bindWarkhamClasses($app);
     // Set framework
     $app['former']->framework('TwitterBootstrap3');
     return $app;
 }