看看这技术行不,希望找到能一起交流smyfony的人,symfony的难度亚于java框架,非得让我写200字,只有贴出一段代码了
上海php装逼大牛群 128026186
<?php
namespace AppBundle\DependencyInjection;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\Config\FileLocator;
class AppExtension extends Extension {
public function load(array $configs, ContainerBuilder $container) {
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
//print_r($config);die;
$container->setParameter('myowoconfig.FOO', $config['foo']);
$loader = new YamlFileLoader(
$container, new FileLocator(DIR . '/../Resources/config')
);
$loader->load('services.yml');
}
public function getAlias() {
return 'myowoconfig'; //bundel名字去掉bundle
}
}
/*
2024 - 快车库 - 我的知识库 重庆启连科技有限公司 渝ICP备16002641号-10
企客连连 表单助手 企服开发 榜单123