webtoucher/yii2-commands

Yii 2 extension wrapper for console controllers.

Installs: 173 514

Dependents: 7

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii-extension

v1.0.3 2014-07-24 05:13 UTC

This package is auto-updated.

Last update: 2024-03-14 20:16:59 UTC


README

Yii 2 extension wrapper for console controllers.

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require webtoucher/yii2-commands "*"

or add

"webtoucher/yii2-commands": "*"

to the require section of your composer.json file.

Usage

Just use for your console controllers class webtoucher\commands\Controller instead of yii\console\Controller like this:

<?php

namespace app\components;

use webtoucher\commands\Controller;


class CommandController extends Controller
{
    public function actionRun()
    {
      ...
    }
}

You can run your command with flag --y to answer 'yes' for every confirms:

$ php yii command --y