We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Encrypt service...

Development and Programming

harsing's avatar
harsing
56 posts
5 years ago
harsing's avatar harsing

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

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
5 years ago
Robin Sowell's avatar Robin Sowell

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.

       
harsing's avatar
harsing
56 posts
5 years ago
harsing's avatar harsing

Embarrasing as it is…the curly quotes was the problem. Thanks and apologies, Robin!

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
5 years ago
Robin Sowell's avatar Robin Sowell

HA! Well, at least it was an easy fix!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.