开发者

Using IvoryGoogleMap bundle in symfony2

开发者 https://www.devze.com 2023-04-02 04:17 出处:网络
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/Ivo

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');
0

精彩评论

暂无评论...
验证码 换一张
取 消