FluxBB\Core\ActionFactory::make PHP Method

make() public method

Create a new action instance.
public make ( string $class ) : Action
$class string
return Action
    public function make($class)
    {
        $action = $this->container->make($class);
        $action->setEvents($this->container->make('events'));
        return $action;
    }

Usage Example

Beispiel #1
0
 /**
  * Resolve an action instance by name.
  *
  * @param $name
  * @return \FluxBB\Core\Action
  * @throws \InvalidArgumentException
  */
 protected function resolveAction($name)
 {
     if (isset($this->actions[$name])) {
         return $this->factory->make($this->actions[$name]);
     }
     throw new \InvalidArgumentException("Named action '{$name}' could not be found.");
 }