diff --git a/demos/index.php b/demos/index.php index 77c2f747c4..0f6976c4a2 100644 --- a/demos/index.php +++ b/demos/index.php @@ -9,16 +9,16 @@ \Atk4\Ui\Header::addTo($app)->set('Welcome to Agile Toolkit Demo!!'); -$t = \Atk4\Ui\Text::addTo(\Atk4\Ui\View::addTo($app, [false, 'green', 'ui' => 'segment'])); +$t = \Atk4\Ui\Text::addTo(\Atk4\Ui\View::addTo($app, [false, 'class.green' => true, 'ui' => 'segment'])); $t->addParagraph('Take a quick stroll through some of the amazing features of Agile Toolkit.'); -\Atk4\Ui\Button::addTo($app, ['Begin the demo..', 'huge primary fluid', 'iconRight' => 'right arrow']) +\Atk4\Ui\Button::addTo($app, ['Begin the demo..', 'class.huge primary fluid' => true, 'iconRight' => 'right arrow']) ->link('tutorial/intro.php'); \Atk4\Ui\Header::addTo($app)->set('What is new in Agile Toolkit 2.0'); -$t = \Atk4\Ui\Text::addTo(\Atk4\Ui\View::addTo($app, [false, 'green', 'ui' => 'segment'])); +$t = \Atk4\Ui\Text::addTo(\Atk4\Ui\View::addTo($app, [false, 'class.green' => true, 'ui' => 'segment'])); $t->addParagraph('In this version of Agile Toolkit we introduce "User Actions"!'); -\Atk4\Ui\Button::addTo($app, ['Learn about User Actions', 'huge basic primary fluid', 'iconRight' => 'right arrow']) +\Atk4\Ui\Button::addTo($app, ['Learn about User Actions', 'class.huge basic primary fluid' => true, 'iconRight' => 'right arrow']) ->link('tutorial/actions.php'); diff --git a/demos/init-app.php b/demos/init-app.php index 679bfcd3a4..02ef3b0640 100644 --- a/demos/init-app.php +++ b/demos/init-app.php @@ -177,7 +177,7 @@ public static function get_class(\Closure $createAnonymousClassFx): string $layout->addMenuItem('Recursive Views', [$path . 'recursive'], $menu); // view demo source page on Github - \Atk4\Ui\Button::addTo($layout->menu->addItem()->addClass('aligned right'), ['View Source', 'teal', 'icon' => 'github']) + \Atk4\Ui\Button::addTo($layout->menu->addItem()->addClass('aligned right'), ['View Source', 'class.teal' => true, 'icon' => 'github']) ->on('click', $app->jsRedirect('https://github.com/atk4/ui/blob/develop/' . $relUrl, true)); } unset($layout, $rootUrl, $relUrl, $demosUrl, $path, $menu); diff --git a/src/View.php b/src/View.php index 9cadc2c7a4..b89c1158de 100644 --- a/src/View.php +++ b/src/View.php @@ -98,9 +98,9 @@ public function __construct($label = []) unset($defaults[0]); } - // @TODO func_num_args() > 1!!!! - if (func_num_args() > 2 || count(array_filter($defaults, 'is_int', \ARRAY_FILTER_USE_KEY)) > 0) { // prevent bad usage + if (func_num_args() > 1 || count(array_filter($defaults, 'is_int', \ARRAY_FILTER_USE_KEY)) > 0) { // prevent bad usage var_dump(func_get_args()); + debug_print_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS); throw new \Error('Too many method arguments'); }