forked from Snck3rs/contao-leaflet-maps
Add frontend module (Close #7).
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user