Using IvoryGoogleMap bundle in symfony2
I have really simple and lame question (i hope it's simple).
I'm quite new to symfony2 and i'm not sure how to use bundles. I'm trying to use IvoryGoogleMapBundle
( https://github.com/egeloen/IvoryGoogleMapBundle ) and i need to say that documentation is really good but i can't understand one thing. I'll write what have i allready done and what i need:
I've uploaded all the bundle files to src/Ivory/GoogleMapBundle
directory. Added proper lines to app/autoload.php
and to app/Autoload.php
(according to documentation).
Now i'm trying to display the most simple map possible and there are a lot of examples in the documentation but i have no idea how to define new Map object in my controller (all the examples presuppose that $map
variable allready exists and holds this object). Can you just write the most simple controller for me whitch will have this $map
variable definition ? Do i need to create all those Entity files mentioned in doc ?
If something is unclear, please just tell 开发者_JAVA百科me, i'll do my best to explain it better.
try $map = $this->get('ivory_google_map.map');
in your controller.
Full list of services you can use (under List of available services)
What are services?
Side note: external bundles should be placed in /vendor/bundles/Organization/BundleName (so /vendor/bundles/Ivory/GoogleMapBundle and not /src/Ivory/GoogleMapBundle )
or else il your controller is :
class DefaultController extends ContainerAware
{
...
}
try this:
$map = $this->container->get('ivory_google_map.map');
精彩评论