Fixed plugins and tests
This commit is contained in:
parent
f514cdafc3
commit
712243660c
14 changed files with 384 additions and 59 deletions
23
app/pluginconfig.example.php
Normal file
23
app/pluginconfig.example.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
return function (PHPCensor\Plugin\Util\Factory $factory) {
|
||||
$factory->registerResource(
|
||||
// This function will be called when the resource is needed.
|
||||
function() {
|
||||
return [
|
||||
'Foo' => "Stuff",
|
||||
'Bar' => "More Stuff"
|
||||
];
|
||||
},
|
||||
|
||||
// In addition to the function for building the resource the system
|
||||
// also needs to be told when to load the resource. Either or both
|
||||
// of the following arguments can be used (null to ignore)
|
||||
|
||||
// This resource will only be given when the argument name is:
|
||||
"ResourceArray",
|
||||
|
||||
// The resource will only be given when the type hint is:
|
||||
PHPCensor\Plugin\Util\Factory::TYPE_ARRAY
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue