TYPO3 10 Viewhelper Class Not Found, Fluid Error
There is some small detail I seem to be missing but I just can't find out what it is...
I get this error:
Error: The ViewHelper "<ugh:example>" could not be resolved. Based on your spelling, the system would load the class "TYPO3\Projectname\ViewHelpers\ExampleViewHelper", however this class does not exist.
I have my own extension called
sitepackage, which works without issues.
ext_localconf.php I wrote
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['ugh'] = ['TYPO3\\Projectname\\ViewHelpers'];
Then there's the directory
Classes with the file
<?php namespace TYPO3\Projectname\ViewHelpers; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; // etc ...
I expect it to use like
What am I missing? Is there something outside of this that I have to do? I'm freaking out about this...
Your global configuration works, yet PHP is not able to find your
I suspect that you have a spelling error or your autoloading information is out of date (assuming a composer-based installation,
composer dump-autoload updates it) or you forgot to add your namespace to
composer.json (see composer docs or a TYPO3 extension example here).
That said, the usual approach is to add ViewHelper namespaces to the Fluid template directly. See https://docs.typo3.org/m/typo3/book-extbasefluid/10.4/en-us/8-Fluid/8-developing-a-custom-viewhelper.html#importing-namespaces
Use TYPO3 InstallTool "rebuild autoload information" or similar to build the class autoloading information. I think ext_emconf.php needs to contain the autoloading information, too.
- → Prevent form action from being followed by robots
- → Render Link within Typoscript Controller
- → How can I implement the sitemaps for a TYPO3 Multidomainsystem when i have only one root folder?
- → TYPO3 - Overriding & adding meta tags (from tx_metaseo) on detail view of custom extension
- → How can i remove the region in TYPO3 9 SEO extension from hreflang
- → generate SEO sitemap for tt_address in TYPO3 and how to beautify with slugs
- → TYPO3 and IOS: can't open the page
- → TYPO3: How do i render tt_content text elements in my own extensions?
- → TYPO3 News Sitemap Configuration - actual date in additionalWhere statement
- → Check the Database of a typo3-Website
- → How to create a record and add an image in database in TYPO3
- → TYPO3 Frontent: Form Action results Page not found
- → RealURL with GET parameters