Closed germain-italic closed 8 years ago
Have you added the according use statement?
// <= 0.9.9
use CRUDlex\CRUDEntity;
// > 0.9.9
use CRUDlex\Entity;
Or include the namespace CRUDlex within the closure:
$app['crud']->getData('library')->pushEvent('before', 'create', function(CRUDlex\Entity $entity) {
// Do something with the entity which is about to be saved.
return true;
});
I extended the documentation a bit here and included the namespace: http://philiplb.github.io/CRUDlex/docs/html/0.9.10/manual/events.html
@ashorlivs Just reopen this issue if that doesn't solve your problem.
Thank you, that actually solved the problem!
Well, broken or I don't know how to use them. Test from a fresh project sample both in v0.9.9 and v0.9.x-dev, I added this on line 38:
New syntax:
Generates:
Old syntax:
Generates: