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

Add modifiers to get information from filepath: dirname, basename, fi… #14198

Merged
merged 1 commit into from Jan 5, 2019
Merged

Add modifiers to get information from filepath: dirname, basename, fi… #14198

merged 1 commit into from Jan 5, 2019

Conversation

kudashevs
Copy link
Contributor

@kudashevs kudashevs commented Dec 11, 2018

What does it do?

Adds group of modifiers to work with placeholders contain filepath. This modifiers allow:

  • dirname - get directory name only (without filename)
  • basename - get file basename (filename with extension)
  • filename - get filename (filename without extension)
  • extension - get file extension

In fact this is a wrapper for PHP's pathinfo() function.

Why is it needed?

Using modifiers more convenient and simple way to work with placeholders contain filepath.

Related issue(s)/PR(s)

PR #14194 updated to clean merge with 3.x branch.

JoshuaLuckers
JoshuaLuckers previously approved these changes Dec 12, 2018
@JoshuaLuckers
Copy link
Contributor

One thing to make this PR even better: is it possible to add some tests for the new modifiers in modOutputFilterTest?
https://github.com/modxcms/revolution/blob/3.x/_build/test/Tests/Model/Filters/modOutputFilterTest.php

@kudashevs
Copy link
Contributor Author

kudashevs commented Dec 15, 2018

One thing to make this PR even better: is it possible to add some tests for the new modifiers in modOutputFilterTest?
https://github.com/modxcms/revolution/blob/3.x/_build/test/Tests/Model/Filters/modOutputFilterTest.php

Done. Since the related files have not changed since the last commit push it force :)

@JoshuaLuckers JoshuaLuckers added this to the v3.0.0-alpha milestone Dec 17, 2018
@JoshuaLuckers JoshuaLuckers added area-core proposal Proposal about improvement aka RFC. Need to be discussed before start implementation. pr/review-needed Pull request requires review and testing. labels Dec 17, 2018
@Mark-H Mark-H added pr/ready-for-merging Pull request reviewed and tested and ready for merging. and removed pr/review-needed Pull request requires review and testing. labels Dec 29, 2018
@alroniks alroniks self-assigned this Dec 29, 2018
@Mark-H
Copy link
Collaborator

Mark-H commented Jan 2, 2019

Hey @kudashevs, have you signed the CLA before? Please do via https://develop.modx.com/contribute/cla/ or let me know what username you used. Thanks!

@kudashevs
Copy link
Contributor Author

kudashevs commented Jan 3, 2019

Hey @kudashevs, have you signed the CLA before? Please do via https://develop.modx.com/contribute/cla/ or let me know what username you used. Thanks!

@Mark-H i didn't sign it before. Just signed it :)

@Mark-H
Copy link
Collaborator

Mark-H commented Jan 3, 2019

Thanks :)

@alroniks alroniks self-assigned this Jan 3, 2019
alroniks pushed a commit to alroniks/revolution that referenced this pull request Jan 5, 2019
…lename, extension [modxcms#14198]

* upstream/pr/14198:
  Add modifiers to get information from filepath: dirname, basename, filename, extension
@alroniks alroniks merged commit ed3df31 into modxcms:3.x Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core pr/ready-for-merging Pull request reviewed and tested and ready for merging. proposal Proposal about improvement aka RFC. Need to be discussed before start implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants