Using code placed in package src directory, how?
Permalink
I followed the information athttps://documentation.concrete5.org/developers/packages/adding-custo... and either I'm missing something or it needs a complete end to end example as I can't get it to work.
I created:
FfwAssessmentLibs subdir in /packages/mypackge/src directory
Above dir contains:
FfwAssessment.php which has the class FfwAssessment in it
package controller has:
protected $pkgAutoloaderRegistries = array('src/FfwAssessmentLibs' => '\FfwAssessmentLibs');
single page controller has:
use \FfwAssessmentLibs as Lib;
attempting to do:
$x = new Lib/FfwAssessment;
Just gives errors. I appreciate that the above assignment is almost certainly wrong but it's roughly the 15th variation i've tried like Lib::FfwAssessment, Lib/FfwAssessment/FfwAssessment, etc, etc, etc
Can anyone say what I missed or provide a link to a real full end to end working example or using the src dir in a package?
I created:
FfwAssessmentLibs subdir in /packages/mypackge/src directory
Above dir contains:
FfwAssessment.php which has the class FfwAssessment in it
package controller has:
protected $pkgAutoloaderRegistries = array('src/FfwAssessmentLibs' => '\FfwAssessmentLibs');
single page controller has:
use \FfwAssessmentLibs as Lib;
attempting to do:
$x = new Lib/FfwAssessment;
Just gives errors. I appreciate that the above assignment is almost certainly wrong but it's roughly the 15th variation i've tried like Lib::FfwAssessment, Lib/FfwAssessment/FfwAssessment, etc, etc, etc
Can anyone say what I missed or provide a link to a real full end to end working example or using the src dir in a package?
I'm using V8.1 so I ignored V7 documentation until in desperation I went and looked at it.
The secret sauce is the namespace statement in the file under the src directory.
Would it kill to not have the documentation split between two versions, e.g. have complete information in the V8.x page? It doesn't seem normal to expect folk to review documentation for a previous (and in some way incompatible, potentially) version to get the full picture for the up to date version they're using.