Xpressengine\Presenter\Html\Tags\Package::register PHP Method

register() public method

register package
public register ( Closure $callback ) : static
$callback Closure callback
return static $this
    public function register(Closure $callback)
    {
        self::$packages[$this->name] = $callback;
        return $this;
    }

Usage Example

Esempio n. 1
0
 /**
  * testLoad
  *
  * @param Package $p
  *
  * @depends testRegister
  */
 public function testLoad(Package $p)
 {
     $self = $this;
     $p->register(function ($handler) use($self) {
         $hi = $handler->sayHi();
         $self->assertEquals('hi', $hi);
     });
     $p->load();
 }