かつお流れ / kryuu-cool-console
ZF2のコンソールモジュールの拡張、ボックスグリッドビューなどを処理します。
dev-master
2016-05-07 09:50 UTC
Requires
- php: ^5.5 || ^7.0
- zendframework/zendframework: ^2.5
This package is not auto-updated.
Last update: 2024-09-14 20:03:57 UTC
README
これは、ZF2アプリケーションがコンソールビューで実行されている場合により良いインターフェースを作成を助けるモジュールです。現在はベータ段階であり、より高度なセレクタリストなど多くの改善が必要です。
インストール
メインセットアップ
Composerで
-
このプロジェクトとKryuuCoolConsoleをcomposer.jsonに追加してください
"require": { "katsuo-ryuu/kryuu-cool-console": "dev-master" }
-
次に、以下のコマンドを実行してComposerにKryuuCoolConsoleをダウンロードさせます
$ php composer.phar update
シンプルなビューの作成
注意現在のシステムには「グリッド」というビュータイプしかありません
<?php
// Create a new view
$view = new Grid();
// Create a nice box with a padding of 1 and a margin of 1
// and make it with double borders
$box = new Box(1,1, Border::BORDER_DOUBLE);
// Setting the background color of the box
$box->setBgColor(Color::BC_MARINE);
// Create a selection list
$choiseList = new ChoiceList();
// Setting the items in the selection list
$choiseList->setItems(['item 1', 'item 2', 'item 3']);
// Adding a nice headline to the list
$choiseList->setHeadline('Please select an item');
// Add the choice list to the box container
$box->addChild($choiseList);
// Add the box to the grid view
$view->addChild($box);
// show the actual view in the terminal
$view->show();