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


PHP ThemeInterface::getCode方法代码示例

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


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

示例1: __construct

 /**
  * @param ThemeInterface $theme
  * @param string $filepath
  */
 public function __construct(ThemeInterface $theme, $filepath)
 {
     $this->name = $filepath;
     $parts = explode('.', basename($filepath), 3);
     if (3 !== count($parts)) {
         throw new \InvalidArgumentException(sprintf('Could not create a translation resource with filepath "%s".', $filepath));
     }
     $this->domain = $parts[0];
     $this->locale = $parts[1] . '_' . $theme->getCode();
     $this->format = $parts[2];
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:15,代码来源:ThemeTranslationResource.php

示例2:

 function it_throws_an_invalid_argument_exception_if_failed_to_instantiate_with_given_filepath(ThemeInterface $theme)
 {
     $theme->getCode()->willReturn('themecode');
     $this->beConstructedWith($theme, 'one.dot');
     $this->shouldThrow(\InvalidArgumentException::class)->duringInstantiation();
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:6,代码来源:ThemeTranslationResourceSpec.php

示例3:

 function it_returns_modified_path_if_its_referencing_bundle_asset(ThemeInterface $theme)
 {
     $theme->getCode()->willReturn("dead42beef");
     $this->resolve('bundles/asset.min.js', $theme)->shouldReturn('bundles/_dead42beef/asset.min.js');
 }
开发者ID:benakacha,项目名称:Sylius,代码行数:5,代码来源:PathResolverSpec.php

示例4:

 function it_returns_resources_locales_while_using_one_nested_theme(TranslationFilesFinderInterface $translationFilesFinder, ThemeRepositoryInterface $themeRepository, ThemeHierarchyProviderInterface $themeHierarchyProvider, ThemeInterface $mainTheme, ThemeInterface $parentTheme)
 {
     $themeRepository->findAll()->willReturn([$mainTheme]);
     $themeHierarchyProvider->getThemeHierarchy($mainTheme)->willReturn([$mainTheme, $parentTheme]);
     $mainTheme->getPath()->willReturn('/main/theme/path');
     $mainTheme->getCode()->willReturn('mainthemecode');
     $parentTheme->getPath()->willReturn('/parent/theme/path');
     $parentTheme->getCode()->willReturn('parentthemecode');
     $translationFilesFinder->findTranslationFiles('/main/theme/path')->willReturn(['/main/theme/path/messages.en.yml']);
     $translationFilesFinder->findTranslationFiles('/parent/theme/path')->willReturn(['/parent/theme/path/messages.en.yml']);
     $this->getResourcesLocales()->shouldReturn(['en_mainthemecode']);
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:12,代码来源:ThemeTranslatorResourceProviderSpec.php

示例5: resolve

 /**
  * {@inheritdoc}
  */
 public function resolve($path, ThemeInterface $theme)
 {
     return str_replace('bundles/', 'bundles/_' . $theme->getCode() . '/', $path);
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:7,代码来源:PathResolver.php


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