I'm rebuilding a component called DogWalk
for Joomla 4 and I've tried to ensure I'm doing exactly what the core Banners
component does. I've named and namespaced my files, named my directories identically to how Banners
does it, but I can't get the BaseController
to find my view file.
I'm dumping the $this->paths
array from BaseController::createView
, and the path is the same for Banners
and for DogWalk
:
array (size=1)
'view' =>
array (size=1)
0 => string '/Users/mystuff/Sites/joomla4/administrator/components/com_dogwalk/views/'
However my component is looking for a file called mycomponentViewviewname
while the actual view class name for Banners
(and all the other admin components) is just HtmlView
. Furthermore the Banners
view class is found even though it's in View
, not views
(despite what $config
array says).
How do I define where the controller will find my views, and what naming convention they would use?
libraries/autoload_psr4.php
file?createView()
andgetView()
methods of the BaseController, then you of course know how it finds the view, if you set your component correctly. I do not really see any good answer on your question here, since most probably you'll will find a typo as usually these questions end up...libraries/vendor/composer/autoload_psr4.php
file-- should that be automatically reloaded when you install a component?libraries/autoload_psr4.php
, should get updated when installing extensions ifExtension - Namespace Updater
plugin is enabled.libraries/autload_psr4.php
. Still not loading the files, but at least we can rule that out.