private function getDefaultPluginOptions()
    {
        $options = [
            'namePlaceholder' => $this->getPlaceholderForName(),
            'deleteAlert' => Yii::t('voskobovich/nestedsets',
                'The nobe will be removed together with the children. Are you sure?'),
            'newNodeTitle' => Yii::t('voskobovich/nestedsets', 'Enter the new node name'),
        ];

        $controller = Yii::$app->controller;
        if ($controller) {
            $options['moveUrl'] = Url::to(["{$controller->id}/moveNode"]);
            $options['createUrl'] = Url::to(["{$controller->id}/createNode"]);
            $options['updateUrl'] = Url::to(["{$controller->id}/updateNode"]);
            $options['deleteUrl'] = Url::to(["{$controller->id}/deleteNode"]);
        }

        if ($this->moveUrl) {
            $this->pluginOptions['moveUrl'] = $this->moveUrl;
        }
        if ($this->createUrl) {
            $this->pluginOptions['createUrl'] = $this->createUrl;
        }
        if ($this->updateUrl) {
            $this->pluginOptions['updateUrl'] = $this->updateUrl;
        }
        if ($this->deleteUrl) {
            $this->pluginOptions['deleteUrl'] = $this->deleteUrl;
        }

        return $options;
    }
private function getDefaultPluginOptions()
    {
        $options = [
            'namePlaceholder' => $this->getPlaceholderForName(),
            'deleteAlert' => Yii::t('voskobovich/nestedsets',
                'The nobe will be removed together with the children. Are you sure?'),
            'newNodeTitle' => Yii::t('voskobovich/nestedsets', 'Enter the new node name'),
        ];

        $controller = Yii::$app->controller;
        if ($controller) {
            $options['moveUrl'] = Url::to(["{$controller->id}/moveNode"]);
            $options['createUrl'] = Url::to(["{$controller->id}/createNode"]);
            $options['updateUrl'] = Url::to(["{$controller->id}/updateNode"]);
            $options['deleteUrl'] = Url::to(["{$controller->id}/deleteNode"]);
        }

        if ($this->moveUrl) {
            $this->pluginOptions['moveUrl'] = $this->moveUrl;
        }
        if ($this->createUrl) {
            $this->pluginOptions['createUrl'] = $this->createUrl;
        }
        if ($this->updateUrl) {
            $this->pluginOptions['updateUrl'] = $this->updateUrl;
        }
        if ($this->deleteUrl) {
            $this->pluginOptions['deleteUrl'] = $this->deleteUrl;
        }

        return $options;
    }
private function getDefaultPluginOptions ( ) { $ options = [ 'namePlaceholder' => $ this -> getPlaceholderForName ( ) , 'deleteAlert' => Yii :: t ( 'voskobovich/nestedsets' , 'The nobe will be removed together with the children. Are you sure?' ) , 'newNodeTitle' => Yii :: t ( 'voskobovich/nestedsets' , 'Enter the new node name' ) , ] ; $ controller = Yii :: $ app -> controller ; if ( $ controller ) { $ options [ 'moveUrl' ] = Url :: to ( [ "{$controller->id}/moveNode" ] ) ; $ options [ 'createUrl' ] = Url :: to ( [ "{$controller->id}/createNode" ] ) ; $ options [ 'updateUrl' ] = Url :: to ( [ "{$controller->id}/updateNode" ] ) ; $ options [ 'deleteUrl' ] = Url :: to ( [ "{$controller->id}/deleteNode" ] ) ; } if ( $ this -> moveUrl ) { $ this -> pluginOptions [ 'moveUrl' ] = $ this -> moveUrl ; } if ( $ this -> createUrl ) { $ this -> pluginOptions [ 'createUrl' ] = $ this -> createUrl ; } if ( $ this -> updateUrl ) { $ this -> pluginOptions [ 'updateUrl' ] = $ this -> updateUrl ; } if ( $ this -> deleteUrl ) { $ this -> pluginOptions [ 'deleteUrl' ] = $ this -> deleteUrl ; } return $ options ; }
Generate default plugin options
@return array
Generate default plugin options