Updating plugin folder
This commit is contained in:
parent
0a05e08a38
commit
018e0a4172
|
|
@ -25,5 +25,4 @@ class Plugin extends PluginBase
|
|||
'\October\Demo\Components\Todo' => 'demoTodo'
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,13 +31,14 @@ class Todo extends ComponentBase
|
|||
{
|
||||
$items = post('items', []);
|
||||
|
||||
if (count($items) >= $this->property('max'))
|
||||
if (count($items) >= $this->property('max')) {
|
||||
throw new \Exception(sprintf('Sorry only %s items are allowed.', $this->property('max')));
|
||||
}
|
||||
|
||||
if (($newItem = post('newItem')) != '')
|
||||
if (($newItem = post('newItem')) != '') {
|
||||
$items[] = $newItem;
|
||||
}
|
||||
|
||||
$this->page['items'] = $items;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue