예제 #1
0
 /**
  * Generates new UI module
  * 
  * @param  string                                      $id   Module ID
  * @param  array                                       $args Module arguments
  * @return Ponticlaro\Bebop\UI\Patterns\ModuleAbstract       Module instance
  */
 public static function __callStatic($id, array $args)
 {
     if (ModuleFactory::canManufacture($id)) {
         $args = isset($args[0]) && is_array($args[0]) ? $args[0] : [];
         return call_user_func_array(array('Ponticlaro\\Bebop\\UI\\Helpers\\ModuleFactory', 'create'), [$id, $args]);
     }
 }
예제 #2
0
 /**
  * Calls to undefined functions
  * 
  * @param  string $name Function name
  * @param  array  $args Function arguments
  * @return object       This class instance
  */
 public function __call($name, array $args = [])
 {
     // Quick method to add sections
     if (ModuleFactory::canManufacture($name)) {
         $args = isset($args[0]) && is_array($args[0]) ? $args[0] : [];
         $section = ModuleFactory::create($name, $args);
         $this->sections->push($section);
     }
     return $this;
 }
예제 #3
0
 /**
  * Adds a single section to a item view
  * 
  * @param string $view View ID
  * @param string $id   Bebop UI Module ID
  * @param array  $args Bebop UI Module configuration
  */
 public function addItemViewSection($view, array $args)
 {
     $ui_id = isset($args['ui']) && $args['ui'] ? $args['ui'] : null;
     if (ModuleFactory::canManufacture($ui_id)) {
         unset($args['ui']);
         $section = ModuleFactory::create($ui_id, $args);
         if ($section) {
             $this->views_sections->push($section, $view);
         }
     }
     return $this;
 }