Concrete 8.0 Binds
Permalinkhttp://clients.designedbygerry.com/concrete8/index.php?cID=1at... the following url you can see the error.
I created a test class located in Application/Src. Its called Testing.php
namespace Application\Src; use Config; class Testing{ function testing(){ return "test"; } }
In Application\Bootstrap\app.php :
Core::bind('testing', function() { return new Application\Src\Testing(); });
Can someone tell me why version 8.0 doesnt like this bind function?
I don't suppose it works if you put a \ before your class reference; eg, new \Application\Src\Testing()
http://documentation.concrete5.org/developers/background/coding-sty...
You can roll your own autoloaders (which will be described in this documentation) but obviously that's pretty inconvenient. If you want to get things working quickly again, you can re-enable this legacy support by adding this array to application/config/app.php:
'enable_legacy_src_namespace' => true
(make sure that file returns a valid array.)
Hope this helps.
http://documentation.concrete5.org/developers/extending-concrete5-w...
1. If Application/Src is now a legacy way to load in our own code, then how should it properly be done in 8.0?
2. How is this handled when upgrading a site from 5.7? Would our custom code (in Application/Src) be ignored after upgrade, until we added that line?
I have posted the updated documentation on this topic; hopefully it clears up a lot of these questions:
http://documentation.concrete5.org/developers/extending-concrete5-w...