public function beforeRun()
    {
        $isValid = true;
        $this->emit(self::EVENT_BEFORE_RUN, [$this, &$isValid]);
        return $isValid;
    }
public function beforeRun()
    {
        $isValid = true;
        $this->emit(self::EVENT_BEFORE_RUN, [$this, &$isValid]);
        return $isValid;
    }
public function beforeRun ( ) { $ isValid = true ; $ this -> emit ( self :: EVENT_BEFORE_RUN , [ $ this , & $ isValid ] ) ; return $ isValid ; }
This method is invoked right before the widget is executed.

The method will trigger the [[EVENT_BEFORE_RUN]] event. The return value of the method
will determine whether the widget should continue to run.

When overriding this method, make sure you call the parent implementation like the following:

```php
public function beforeRun()
{
if (!parent::beforeRun()) {
return false;
}

// your custom code here

return true; // or false to not run the widget
}
```
@return bool
This method is invoked right before the widget is executed .