本文整理汇总了PHP中camelcase函数的典型用法代码示例。如果您正苦于以下问题:PHP camelcase函数的具体用法?PHP camelcase怎么用?PHP camelcase使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了camelcase函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLegacyKeyClass
public function getLegacyKeyClass()
{
$class = camelcase($this->getCategoryEntity()->getAttributeKeyCategoryHandle());
$prefix = $this->getCategoryEntity()->getPackageID() > 0 ? $this->getCategoryEntity()->getPackageHandle() : false;
$class = core_class('Core\\Attribute\\Key\\' . $class . 'Key', $prefix);
return $class;
}
示例2: import
public function import(\SimpleXMLElement $sx)
{
$em = \Database::connection()->getEntityManager();
$em->getClassMetadata('Concrete\\Core\\Entity\\Express\\Association')->setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator());
if (isset($sx->expressentities)) {
foreach ($sx->expressentities->entity as $entityNode) {
if (isset($entityNode->associations)) {
foreach ($entityNode->associations->association as $associationNode) {
$association = $em->find('Concrete\\Core\\Entity\\Express\\Association', (string) $associationNode['id']);
if (!is_object($association)) {
$class = '\\Concrete\\Core\\Entity\\Express\\' . camelcase((string) $associationNode['type']) . 'Association';
$association = new $class();
$association->setId((string) $associationNode['id']);
}
/**
* @var $association \Concrete\Core\Entity\Express\Association
*/
$association->setTargetPropertyName((string) $associationNode['target-property-name']);
$association->setInversedByPropertyName((string) $associationNode['inversed-by-property-name']);
$em->persist($association);
}
}
}
}
$em->flush();
$em->getClassMetadata('Concrete\\Core\\Entity\\Express\\Association')->setIdGenerator(new UuidGenerator());
}
示例3: controller
public static function controller($item)
{
if ($item instanceof \Page) {
return $item->getController();
}
$controller = '\\Concrete\\Controller\\' . camelcase($item);
return new $controller();
}
示例4: testCamelcase
/**
* test camelcase
*/
public function testCamelcase()
{
$this->assertEquals('fooBar', camelcase('foo bar'));
$this->assertEquals('fooBar', camelcase('FooBar'));
$this->assertEquals('fooBar', camelcase('foo-bar'));
$this->assertEquals('fooBar', camelcase('foo_bar'));
$this->assertEquals('fooBarBazQUX', camelcase('foo - bar, .Baz QUX'));
}
示例5: getConfigurationObject
/**
* @return \Concrete\Core\File\StorageLocation\Configuration\ConfigurationInterface
*/
public function getConfigurationObject()
{
if ($this->getPackageID()) {
return Core::make('\\Concrete\\Package\\' . camelcase($this->getPackageHandle()) . '\\Core\\File\\StorageLocation\\Configuration\\' . camelcase($this->getHandle()) . 'Configuration');
} else {
return Core::make('\\Concrete\\Core\\File\\StorageLocation\\Configuration\\' . camelcase($this->getHandle()) . 'Configuration');
}
}
示例6: getController
protected function getController()
{
try {
$class = camelcase(substr($this->filename, 0, strrpos($this->filename, '.php')));
return \Core::make('\\Concrete\\Block\\ExternalForm\\Form\\Controller\\' . $class);
} catch (\Exception $e) {
}
}
示例7: driver
public function driver($driver = null)
{
$method = 'create' . camelcase($driver) . 'Driver';
// If a custom driver is not registered, we use unmapped
if ($driver && !isset($this->customCreators[$driver]) && !method_exists($this, $method)) {
return $this->createStandardDriver();
}
return parent::driver($driver);
}
示例8: getLibrary
public static function getLibrary()
{
if (!PageCache::$library) {
$adapter = Config::get('concrete.cache.page.adapter');
$class = overrideable_core_class('Core\\Cache\\Page\\' . camelcase($adapter) . 'PageCache', DIRNAME_CLASSES . '/Cache/Page/' . camelcase($adapter) . 'PageCache.php');
PageCache::$library = new $class();
}
return PageCache::$library;
}
示例9: controller
public static function controller($item)
{
if ($item instanceof \Page) {
return $item->getController();
}
$controller = '\\Concrete\\Controller\\' . camelcase($item);
$app = Facade::getFacadeApplication();
return $app->build($controller);
}
示例10: getClass
public static function getClass($pkgHandle)
{
if (is_dir(DIR_STARTING_POINT_PACKAGES . '/' . $pkgHandle)) {
$class = '\\Application\\StartingPointPackage\\' . camelcase($pkgHandle) . '\\Controller';
} else {
$class = '\\Concrete\\StartingPointPackage\\' . camelcase($pkgHandle) . '\\Controller';
}
$cl = new $class();
return $cl;
}
示例11: getController
protected function getController()
{
try {
$class = camelcase(substr($this->filename, 0, strrpos($this->filename, '.php')));
$cl = \Core::make(overrideable_core_class('Block\\ExternalForm\\Form\\Controller\\' . $class, DIRNAME_BLOCKS . '/external_form/form/controller/' . $this->filename));
$cl->bID = $this->bID;
return $cl;
} catch (\Exception $e) {
}
}
示例12: getController
public function getController()
{
if (isset($this->controller)) {
return $this->controller;
} else {
$class = overrideable_core_class('MenuItem\\' . camelcase($this->handle) . '\\Controller', DIRNAME_MENU_ITEMS . '/' . $this->handle . '/' . FILENAME_CONTROLLER, $this->pkgHandle);
$this->setController(\Core::make($class, array($this)));
return $this->controller;
}
}
示例13: registerPackage
public function registerPackage(Package $pkg)
{
$symfonyLoader = new SymfonyClassloader();
$symfonyLoader->addPrefix(NAMESPACE_SEGMENT_VENDOR . '\\Package\\' . camelcase($pkg->getPackageHandle()) . '\\Attribute', DIR_PACKAGES . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_ATTRIBUTES);
$symfonyLoader->addPrefix(NAMESPACE_SEGMENT_VENDOR . '\\Package\\' . camelcase($pkg->getPackageHandle()) . '\\Authentication', DIR_PACKAGES . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_AUTHENTICATION);
$symfonyLoader->addPrefix(NAMESPACE_SEGMENT_VENDOR . '\\Package\\' . camelcase($pkg->getPackageHandle()) . '\\Block', DIR_PACKAGES . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_BLOCKS);
$symfonyLoader->addPrefix(NAMESPACE_SEGMENT_VENDOR . '\\Package\\' . camelcase($pkg->getPackageHandle()) . '\\Theme', DIR_PACKAGES . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_THEMES);
$symfonyLoader->addPrefix(NAMESPACE_SEGMENT_VENDOR . '\\Package\\' . camelcase($pkg->getPackageHandle()) . '\\Controller\\PageType', DIR_PACKAGES . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_CONTROLLERS . '/' . DIRNAME_PAGE_TYPES);
$symfonyLoader->addPrefix(NAMESPACE_SEGMENT_VENDOR . '\\Package\\' . camelcase($pkg->getPackageHandle()) . '\\Controller', DIR_PACKAGES . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_CONTROLLERS);
$symfonyLoader->addPrefix(NAMESPACE_SEGMENT_VENDOR . '\\Package\\' . camelcase($pkg->getPackageHandle()) . '\\Job', DIR_PACKAGES . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_JOBS);
$symfonyLoader->addPrefix(NAMESPACE_SEGMENT_VENDOR . '\\Package\\' . camelcase($pkg->getPackageHandle()), DIR_PACKAGES . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_CLASSES);
$symfonyLoader->register();
}
示例14: parse
public function parse()
{
$sl = new StyleList();
foreach ($this->root->set as $xset) {
$set = $sl->addSet((string) $xset['name']);
foreach ($xset->style as $xstyle) {
$type = camelcase((string) $xstyle['type']);
$style = Core::make('\\Concrete\\Core\\StyleCustomizer\\Style\\' . $type . 'Style');
$style->setName((string) $xstyle['name']);
$style->setVariable((string) $xstyle['variable']);
$set->addStyle($style);
}
}
return $sl;
}
示例15: getByHandle
public static function getByHandle($scsHandle)
{
$db = Loader::db();
$r = $db->GetRow('select scsHandle, scsIsActive, pkgID, scsName from SystemContentEditorSnippets where scsHandle = ?', array($scsHandle));
if (is_array($r) && $r['scsHandle']) {
$pkgHandle = false;
if ($r['pkgID']) {
$pkgHandle = PackageList::getHandle($r['pkgID']);
}
$class = overrideable_core_class('Core\\Editor\\' . camelcase($r['scsHandle']) . 'Snippet', DIRNAME_CLASSES . '/Editor/' . camelcase($r['scsHandle']) . 'Snippet.php', $pkgHandle);
$sc = Core::make($class);
$sc->setPropertiesFromArray($r);
return $sc;
}
}