Exemple #1
0
 /**
  * Preload the object in defined in the action
  * @param  Packfire\FuelBlade\ContainerInterface $container The FuelBlade IoC Container
  * @param  string|mixed $action The action string or object to load
  * @return array|callback Returns the array of callback
  */
 public static function loadCallback(ContainerInterface $container, $action)
 {
     if (is_string($action)) {
         $pos = strpos($action, '::');
         if ($pos !== false) {
             $action = array(substr($action, 0, $pos), substr($action, $pos + 2));
             $action[0] = $container->instantiate($action[0]);
         }
     }
     return $action;
 }
Exemple #2
0
 /**
  * Create a Factory object
  * @since 1.0.0
  */
 public function __construct()
 {
     $this->objects = new ObjectCollection();
     $this->container = new Container();
     $this->container['Samsui\\DefinitionInterface'] = $this->container->instance('Samsui\\Definition');
 }