doctrine:
orm:
auto_generate_proxy_classes: false
.find( 'select[name=payment_method]' ).change()
this.$order_review.on( 'change', 'select[name=payment_method]', this.payment_method_selected );
// удалить обе строки ниже, по умолчанию select установлен в первую опцию
$( '.woocommerce-checkout' ).find( 'input[name=payment_method]:eq(0)' ).attr( 'checked', 'checked' );
$( '.woocommerce-checkout' ).find( 'input[name=payment_method]:checked' ).eq(0).trigger( 'click' );
$alias = ucwords($rang['alias']);
$className = DESIRED_NAMESPACE . $alias;
$rang = $className::getInstance();
// Или лучше
$rang = $application->getUserRang($alias);
// Проверка юзера
$rang->isUserMeetRequirements($user);
// $pathToRangsClass - это пространство имен или путь к файлу?
if(!class_exists($pathToRangsClass.$alias))
public static function getInstance($className=__CLASS__)
{
return new $className;
}
# добавил в config_dev.yml
jms_i18n_routing:
default_locale: en
locales: [de, en]
strategy: prefix_except_default
<?php
// AppKernel.php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new JMS\I18nRoutingBundle\JMSI18nRoutingBundle();
$bundles[] = new JMS\TranslationBundle\JMSTranslationBundle();
$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}
<!-- services.xml -->
<service id="kernel.listener.url" class="Acme\DemoBundle\EventListener\Url">
<argument type="service" id="router" />
</service>
<?php
namespace Acme\DemoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class WelcomeController extends Controller
{
public function indexAction()
{
/*
* The action's view can be rendered using render() method
* or @Template annotation as demonstrated in DemoController.
*
*/
$urlListener = $this->get('kernel.listener.url');
// выводит JMS\I18nRoutingBundle\Router\I18nRouter
echo get_class($urlListener->getRouter());
return $this->render('AcmeDemoBundle:Welcome:index.html.twig');
}
}
</php>
$ php app/console container:debug
$ php application.php container:debug