当前位置: 首页>>代码示例>>PHP>>正文


PHP Bundle::getName方法代码示例

本文整理汇总了PHP中Symfony\Component\HttpKernel\Bundle\Bundle::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Bundle::getName方法的具体用法?PHP Bundle::getName怎么用?PHP Bundle::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\HttpKernel\Bundle\Bundle的用法示例。


在下文中一共展示了Bundle::getName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: registerInstallerService

 /**
  * Register an installer service
  *
  * @param BaseBundle $bundleInfos
  * @param string $type Type (install, update or uninstall)
  * @param string $class Class (Install, Update or Uninstall)
  */
 protected function registerInstallerService(BaseBundle $bundleInfos, $type, $class)
 {
     $serviceId = strtolower($bundleInfos->getName()) . '.installer.' . $type;
     $fullyQualifiedClass = $bundleInfos->getNamespace() . '\\Service\\Install\\' . $class;
     $serviceOptions = array('calls' => array(array('setContainer' => array('@service_container'))), 'tags' => array(array('name' => 'bundle.' . $type)));
     $this->registerService($bundleInfos->getName(), $serviceId, $fullyQualifiedClass, $serviceOptions);
 }
开发者ID:kujaff,项目名称:versionsbundle,代码行数:14,代码来源:Generator.php

示例2: add

 /**
  * Add
  * 
  * Add a FrameworkBundle
  * to the collection
  * 
  * @param FrameworkBundle $bundle - the FrameworkBundle to add
  * 
  * @return BundleCollection - the current instance
  */
 public function add(Bundle $bundle)
 {
     if (!$this->has($bundle->getName())) {
         $this->bundles[] = $bundle;
     }
     return $this;
 }
开发者ID:cscfa,项目名称:NavBarBundle,代码行数:17,代码来源:BundleCollection.php

示例3: generateTemplates

 /**
  * @param Bundle          $bundle     The bundle
  * @param array           $parameters The template parameters
  * @param string          $rootDir    The root directory
  * @param OutputInterface $output
  */
 public function generateTemplates(Bundle $bundle, array $parameters, $rootDir, OutputInterface $output)
 {
     $dirPath = $bundle->getPath();
     $fullSkeletonDir = $this->skeletonDir . '/Resources/views';
     $this->filesystem->copy(__DIR__ . '/../Resources/SensioGeneratorBundle/skeleton' . $fullSkeletonDir . '/Pages/Search/SearchPage/view.html.twig', $dirPath . '/Resources/views/Pages/Search/SearchPage/view.html.twig', true);
     GeneratorUtils::prepend("{% extends '" . $bundle->getName() . ":Page:layout.html.twig' %}\n", $dirPath . '/Resources/views/Pages/Search/SearchPage/view.html.twig');
     $output->writeln('Generating Twig Templates : <info>OK</info>');
 }
开发者ID:headonkeyboard,项目名称:KunstmaanBundlesCMS,代码行数:14,代码来源:SearchPageGenerator.php

示例4: doMigrate

 private function doMigrate(Bundle $bundle, $version, $direction)
 {
     $action = $direction === Migrator::DIRECTION_UP ? 'Ugprading' : 'Downgrading';
     $this->log("{$action} bundle '{$bundle->getName()}'...");
     $queries = $this->migrator->migrate($bundle, $version, $direction);
     $currentVersion = $this->migrator->getCurrentVersion($bundle);
     $this->log(count($queries) === 0 ? "Nothing to execute: bundle is already at version {$currentVersion}" : "Done: bundle is now at version {$currentVersion}");
 }
开发者ID:claroline,项目名称:distribution,代码行数:8,代码来源:Manager.php

示例5: generateTemplates

 /**
  * @param Bundle          $bundle     The bundle
  * @param string          $entity     The name of the entity
  * @param array           $parameters The template parameters
  * @param OutputInterface $output
  */
 public function generateTemplates(Bundle $bundle, $entity, array $parameters, OutputInterface $output)
 {
     $dirPath = sprintf("%s/Resources/views", $bundle->getPath());
     $skeletonDir = sprintf("%s/Resources/views", $this->skeletonDir);
     $fullSkeletonDir = sprintf("%s/Resources/views", $this->fullSkeletonDir);
     $this->filesystem->copy($fullSkeletonDir . '/OverviewPage/view.html.twig', $dirPath . '/Pages/' . $entity . 'OverviewPage/view.html.twig', true);
     GeneratorUtils::prepend("{% extends '" . $bundle->getName() . ":Layout:layout.html.twig' %}\n", $dirPath . '/Pages/' . $entity . 'OverviewPage/view.html.twig');
     $this->filesystem->copy($fullSkeletonDir . '/OverviewPage/pagetemplate.html.twig', $dirPath . '/Pages/' . $entity . 'OverviewPage/pagetemplate.html.twig', true);
     $this->filesystem->copy($fullSkeletonDir . '/Page/view.html.twig', $dirPath . '/Pages/' . $entity . 'Page/view.html.twig', true);
     GeneratorUtils::prepend("{% extends '" . $bundle->getName() . ":Layout:layout.html.twig' %}\n", $dirPath . '/Pages/' . $entity . 'Page/view.html.twig');
     $this->filesystem->copy($fullSkeletonDir . '/Page/pagetemplate.html.twig', $dirPath . '/Pages/' . $entity . 'Page/pagetemplate.html.twig', true);
     $this->renderFile($skeletonDir . '/PageAdminList/list.html.twig', $dirPath . '/AdminList/' . '/' . $entity . 'PageAdminList/list.html.twig', $parameters);
     $output->writeln('Generating twig templates : <info>OK</info>');
 }
开发者ID:axelvnk,项目名称:KunstmaanBundlesCMS,代码行数:20,代码来源:ArticleGenerator.php

示例6: addBundle

 /**
  * addBundle.
  *
  * @param Bundle|BundleReferenceInterface $bundle
  * @param string|array|null               $env
  * @param int                             $priority
  *
  * @return $this
  */
 public function addBundle($bundle, $env = null, $priority = 0)
 {
     if ($this->isCurrentEnvironment($env)) {
         if ($bundle instanceof Bundle || $bundle instanceof BundleReferenceInterface) {
             $this->bundles[$bundle->getName()] = ['name' => $bundle->getName(), 'bundle' => $bundle, 'priority' => $priority];
         } else {
             throw new \InvalidArgumentException('Bundle parameter should be a valid bundle or reference.');
         }
     }
     return $this;
 }
开发者ID:ynloultratech,项目名称:framework,代码行数:20,代码来源:KernelBuilder.php

示例7: updateRouting

 /**
  * @param DialogHelper    $dialog      The dialog helper
  * @param InputInterface  $input       The command input
  * @param OutputInterface $output      The command output
  * @param Bundle          $bundle      The bundle
  * @param string          $entityClass The classname of the entity
  *
  * @return void
  */
 protected function updateRouting(DialogHelper $dialog, InputInterface $input, OutputInterface $output, Bundle $bundle, $entityClass)
 {
     $auto = true;
     $multilang = false;
     if ($input->isInteractive()) {
         $multilang = $dialog->askConfirmation($output, $dialog->getQuestion('Is it a multilanguage site', 'yes', '?'), true);
         $auto = $dialog->askConfirmation($output, $dialog->getQuestion('Do you want to update the routing automatically', 'yes', '?'), true);
     }
     $prefix = $multilang ? '/{_locale}' : '';
     $code = sprintf("%s:\n", strtolower($bundle->getName()) . '_' . strtolower($entityClass) . '_admin_list');
     $code .= sprintf("    resource: @%s/Controller/%sAdminListController.php\n", $bundle->getName(), $entityClass);
     $code .= "    type:     annotation\n";
     $code .= sprintf("    prefix:   %s/admin/%s/\n", $prefix, strtolower($entityClass));
     if ($multilang) {
         $code .= "    requirements:\n";
         $code .= "         _locale: %requiredlocales%\n";
     }
     if ($auto) {
         $file = $bundle->getPath() . '/Resources/config/routing.yml';
         $content = '';
         if (file_exists($file)) {
             $content = file_get_contents($file);
         } elseif (!is_dir($dir = dirname($file))) {
             mkdir($dir, 0777, true);
         }
         $content .= "\n";
         $content .= $code;
         if (false === file_put_contents($file, $content)) {
             $output->writeln($dialog->getHelperSet()->get('formatter')->formatBlock("Failed adding the content automatically", 'error'));
         } else {
             return;
         }
     }
     $output->writeln('Add the following to your routing.yml');
     $output->writeln('/*******************************/');
     $output->write($code);
     $output->writeln('/*******************************/');
 }
开发者ID:tentwofour,项目名称:KunstmaanGeneratorBundle,代码行数:47,代码来源:GenerateAdminListCommand.php

示例8: getConfiguration

 private function getConfiguration(Bundle $bundle)
 {
     if (isset($this->cacheConfigs[$bundle->getName()])) {
         return $this->cacheConfigs[$bundle->getName()];
     }
     $driverName = $this->connection->getDriver()->getName();
     $migrationsDir = "{$bundle->getPath()}/Migrations/{$driverName}";
     $migrationsName = "{$bundle->getName()} migration";
     $migrationsNamespace = "{$bundle->getNamespace()}\\Migrations\\{$driverName}";
     $migrationsTableName = 'doctrine_' . strtolower($bundle->getName()) . '_versions';
     $config = new Configuration($this->connection);
     $config->setName($migrationsName);
     $config->setMigrationsDirectory($migrationsDir);
     $config->setMigrationsNamespace($migrationsNamespace);
     $config->setMigrationsTableName($migrationsTableName);
     if (is_dir($migrationsDir)) {
         $config->registerMigrationsFromDirectory($migrationsDir);
     }
     $this->cacheConfigs[$bundle->getName()] = $config;
     return $config;
 }
开发者ID:claroline,项目名称:distribution,代码行数:21,代码来源:Migrator.php

示例9: getBundleAssetPath

 /**
  * Get bundle asset path relativeo to web dirtectory
  *
  * @param  Symfony\Component\HttpKernel\Bundle\Bundle $bundle
  * @return string
  */
 private function getBundleAssetPath(Bundle $bundle)
 {
     return 'bundles/' . preg_replace('/bundle$/', '', strtolower($bundle->getName()));
 }
开发者ID:hikmahtiar6,项目名称:drafterbit,代码行数:10,代码来源:AssetsExtension.php


注:本文中的Symfony\Component\HttpKernel\Bundle\Bundle::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。