Add frontend module (Close #7).

This commit is contained in:
David Molineus
2015-01-09 23:20:07 +01:00
parent 47d27e9c4a
commit 91ccfa56f4
9 changed files with 222 additions and 12 deletions

View File

@@ -11,6 +11,7 @@
namespace Netzmacht\Contao\Leaflet\Dca;
use Netzmacht\Contao\DevTools\Dca\Options\OptionsBuilder;
use Netzmacht\Contao\Leaflet\Model\MapModel;
/**
@@ -26,16 +27,9 @@ class Content
*/
public function getMaps()
{
$options = array();
$collection = MapModel::findAll();
if ($collection) {
foreach ($collection as $map) {
$options[$map->id] = $map->title;
}
}
return $options;
return OptionsBuilder::fromCollection($collection, 'id', 'title')->getOptions();
}
public function getEditMapLink($dataContainer)