Updating plugin folder

This commit is contained in:
Stefan Talen 2014-10-18 12:49:29 +02:00
parent 0a05e08a38
commit 018e0a4172
2 changed files with 6 additions and 6 deletions

View File

@ -25,5 +25,4 @@ class Plugin extends PluginBase
'\October\Demo\Components\Todo' => 'demoTodo'
];
}
}
}

View File

@ -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;
}
}
}