Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Module name for sidebar #182

Closed
armababy opened this issue Mar 2, 2016 · 7 comments
Closed

[Core] Module name for sidebar #182

armababy opened this issue Mar 2, 2016 · 7 comments

Comments

@armababy
Copy link
Member

armababy commented Mar 2, 2016

Problem: http://forum.asgardcms.com/topic/37/sidebar-not-showing

It seems that $module->getName() always return flat module name. Making impossible to use two+ word camel case module names.

@nWidart
Copy link
Member

nWidart commented Mar 2, 2016

Sadly that's related to the module package, not on asgardcms.

@armababy
Copy link
Member Author

armababy commented Mar 2, 2016

Yeah was browsing pingpong saw that it returns flat name.

What if we use something like $module->get('name')?
It will return correct one from json object Module.php

Something like $name = $module->get('name', $module->getStudlyName());

@nWidart
Copy link
Member

nWidart commented Mar 2, 2016

Interesting, this might be worth trying indeed.

@armababy
Copy link
Member Author

armababy commented Mar 2, 2016

As far as i can test it works consistently, since module will not work without module.json and required attributes we can pretty much rely on this.

vendor/ImageDimensionValue

Imagedimensionvalue | studly_case($module->getName()
imagedimensionvalue | $module->getName()
Imagedimensionvalue | $module->getStudlyName()
ImageDimensionValue | $module->get('name')

Want me to pull request or you will do it?

@n3ISe
Copy link

n3ISe commented Mar 3, 2016

@armababy thanks for the solution. Double Thumbs Up

@armababy
Copy link
Member Author

armababy commented Mar 6, 2016

Damn all this studly_case, hypen, dash, camelcase situation so broken :)
Once you create camelcase module and then try to install it from repository name is getting messed up again, it creates folder with ucfirst it seems and breaks all your PSR highligting in editor since folders do not match namespaces.

The ping-pong/modules are just using lowercase name for vendor/package striping hypens, altho they are perfectly fine for package name in composer.json.

@armababy
Copy link
Member Author

armababy commented May 6, 2016

Fixed and merged AsgardCms/Core#85

@armababy armababy closed this as completed May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants