Skip navigation


This is just a very simple snippets, yet I can’t find it anywhere. I guess this rarely met.

Here’s how to use multiline input using Yii ConsoleCommand. In the console command class, use `$args` parameter in the console action.

public function actionIndex($args=array()){
   print_r($args)
}

Then you can execute something like command below which tries to input a JSON string to the console command.

$yii command index '{
   "name": "value"
}'

and the console will return

Array
(
    [0] => {
   "name": "value"
}
)

One Comment

  1. Hi,
    Thanks for providing information on Yii framework. I think Yii is a fast, secure, high performance PHP framework for developing web 2.0 applications, and The Yii Development is top class, affordable and offer several features to build unique and quality applications.


Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: