I’m trying to use the encrypt service like this:
$var = ee(‘Encrypt’)->encrypt(”Sometext”);
However nothing is passed to $var. I tried without an encryption key as well as with my own 32 byte key. There is no information in docs about how to initialize a service (if it’s needed?).
What am I doing wrong?
Regards, Matts
You’re not doing anything wrong that I can see- and the code works in my testing (once I get rid of the curly quotes).
Any errors? If you var_dump $var is it an empty string?
If you drop it in a template with php parsing on, does it work? That’s how I tested. But you should need to initialize or anything.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.