ZF-10839: Subclasses of HeadMeta view helper could implement new meta types more easily by refactoring a single preg_match() pattern into a protected member.
A recent question on StackOverflow asked about how to make the HeadMeta view helper output a tag like:
<meta property="mykey" content="myvalue">
Essentially, adding a new "property" as a new type of meta key.
The solution - subclassing HeadMeta - is straight-forward enough:
- Modify the preg_match pattern used in the __call() method
- Override the protected member $_keyTypes
- Override the protected method _normalizeType().
But the preg_match pattern used in Zend_View_Helper_HeadMeta::__call() method is inline. To override it, the subclass ends up duplicating nearly the entire __call method, simply to change the pattern from:
It would be easier if this pattern were refactored out into a protected member. Then subclass would only have to override the protected member rather than duplicate so much of the parent's__call() method.
Just a thought...
Thanks and cheers! ;-)