Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

allow to filter the templates by extension in the templatemap generator #6930

Conversation

rohm1
Copy link

@rohm1 rohm1 commented Nov 26, 2014

I have added an option to filter the templates by extension in the templatemap generator. Accepted format is a regex alternation. Examples:

  • phtml
  • phtml|html
  • p*
  • *html

Sometimes in the view directory there are some license or image files, and they shouldn't be included in the templatemap.

$fileExtensions = '*';
if (isset($opts->e) && $opts->e != '*') {
if (!preg_match('/^([[:alnum:]]\*?+\|?)+$/', $opts->e)) {
echo 'Invalid extensions list specified' . PHP_EOL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May want to be a bit more descriptive here.

@Ocramius Ocramius added this to the 2.4.0 milestone Nov 26, 2014
@Ocramius Ocramius self-assigned this Nov 26, 2014
@rohm1
Copy link
Author

rohm1 commented Nov 27, 2014

@Ocramius better error message as requested. Also added the wild card option at beginning of extensions.

Ocramius added a commit that referenced this pull request Nov 27, 2014
@Ocramius
Copy link
Member

This was merged into develop at 22ed3ab, thanks @rohm1!

@Ocramius Ocramius closed this Nov 27, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants