public function actionIndex($callback, $id)
    {
        $model = NavItemPageBlockItem::findOne($id);
        
        if (!$model) {
            throw new Exception("Unable to find item id.");
        }
        
        $block = $model->block->getObject($model->id, 'callback');

        if (!$block) {
            throw new Exception("Unable to find block object.");
        }
        
        return ObjectHelper::callMethodSanitizeArguments($block, $this->callbackToMethod($callback), Yii::$app->request->get());
    }
public function actionIndex($callback, $id)
    {
        $model = NavItemPageBlockItem::findOne($id);
        
        if (!$model) {
            throw new Exception("Unable to find item id.");
        }
        
        $block = $model->block->getObject($model->id, 'callback');

        if (!$block) {
            throw new Exception("Unable to find block object.");
        }
        
        return ObjectHelper::callMethodSanitizeArguments($block, $this->callbackToMethod($callback), Yii::$app->request->get());
    }
public function actionIndex ( $ callback , $ id ) { $ model = NavItemPageBlockItem :: findOne ( $ id ) ; if ( ! $ model ) { throw new Exception ( "Unable to find item id." ) ; } $ block = $ model -> block -> getObject ( $ model -> id , 'callback' ) ; if ( ! $ block ) { throw new Exception ( "Unable to find block object." ) ; } return ObjectHelper :: callMethodSanitizeArguments ( $ block , $ this -> callbackToMethod ( $ callback ) , Yii :: $ app -> request -> get ( ) ) ; }
Run the callback for a given block.

@param string $callback The name of the callback to call inside the block object.
@param integer $id The id of the block item where the callbacke is located.
@throws \luya\cms\Exception
@return mixed
Run the callback for a given block .