Grav\Plugin\Admin\AdminController::taskUninstall PHP Method

taskUninstall() public method

Handles uninstalling plugins and themes
Deprecation:
public taskUninstall ( ) : boolean
return boolean True if the action was performed
    public function taskUninstall()
    {
        $type = $this->view === 'plugins' ? 'plugins' : 'themes';
        if (!$this->authorizeTask('uninstall ' . $type, ['admin.' . $type, 'admin.super'])) {
            return false;
        }
        $package = $this->route;
        $result = Gpm::uninstall($package, []);
        if ($result) {
            $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.UNINSTALL_SUCCESSFUL'), 'info');
        } else {
            $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.UNINSTALL_FAILED'), 'error');
        }
        $this->post = ['_redirect' => $this->view];
        return true;
    }