-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Methods of CoreExtensions expected in own writer extension #5
Comments
I think that's the same problem as deregistering an extension. Originally posted by @froschdesign at zendframework/zend-feed#87 (comment) |
Please look at #90 and my idea for an improvement. I think this should help also for you problem – remove core extension and add a custom extension. Originally posted by @froschdesign at zendframework/zend-feed#87 (comment) |
Thank's for the info. Fortunately I kept an old branch with my attempts. I modified the code: /** @var \Zend\Feed\Writer\StandaloneExtensionManager $em */
$em = \Zend\Feed\Writer\Writer::getExtensionManager();
$em->remove('ITunes\Renderer\Feed');
$em->remove('GooglePlayPodcast\Renderer\Feed');
$em->add(
'Webfeed\Renderer\Feed',
\Webfeed\Writer\Renderer\Feed::class
);
Writer::setExtensionManager($em);
Writer::registerExtension('Webfeed'); With the removal of Originally posted by @av3 at zendframework/zend-feed#87 (comment) |
@av3 Originally posted by @froschdesign at zendframework/zend-feed#87 (comment) |
Thank you for your writer example, froschdesign. I tested it and am getting an error message. This time I created a separate issue, because it's not related to the documentation ;)
I created an Entry class (
extends Extension\AbstractRenderer
) and registered it in my handler. But the output of my atom feed fails (using the export method). I get the error message:call_user_func_array() expects parameter 1 to be a valid callback, class 'Webfeed\Writer\Renderer\Entry' does not have a method 'getItunesAuthors'
I can see that
$authors = $this->getDataContainer()->getItunesAuthors();
ofWriter/Extension/ITunes/Renderer/Entry.php
is executed, before it fails. Why should my own Renderer need getItunesAuthors?I assume on reason is that
registerCoreExtensions()
is called in the AbstractFeed constructor. Unfortunately I can't see a method to unregister the extension. When removing iTunes in the registerCoreExtensions method, the methodgetPlayPodcastBlock
is expected. It would work if I remove everything except Atom.Is this an unexpected behavior or am I doing something wrong?
Originally posted by @av3 at zendframework/zend-feed#87
The text was updated successfully, but these errors were encountered: