there is a service my_service with getItems() method
there is a main layout index.html.php

somethere in main layout i want to get my_service items, what i need
to do?
call my_service_controller? // $view['actions']-
>render('myBundle:my_service_controller:action')
and then in my_service_controller:
public function actionAction()
{
    $this->render('myBundle:View:my_service_template', array('items'
=> $this->get('my_service')->getItems())
}

ok, all of this takes about 370-450 ms  (i have a lot of stuff in
$items)


and now, i want to get items in the template directly from the service
i cant found any way to do this, so i have changed Symfony\Bundle
\FrameworkBundle\Templating\GlobalVariables

public function getService($serviceName)
{
        if ($this->container->has($serviceName) && $service = $this-
>container->get($serviceName)) {
                return $service;
        }
}

and now, it takes about 150-200 ms.......

so, any sollution to make it correct, without editing framework?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to