0

I'm currently trying to run variables that are declared in a model in a function for checking and creating an email user.

The issue I'm having is that the variables being declared in model A.

const USERNAME = ':email_username';
const PASSWORD = ':email_password';

Do not work when I call them in Model B such as

 $email_user = SystemEmail::USERNAME;
        //$email_user ="NewtestRemail";
        //$email_password = "PDmfSqR520eH";
  $email_password = SystemEmail::PASSWORD;

I have also tried SystemEmail::model()->email_username;

But had no luck. Any ideas?

Calimero
  • 4,238
  • 1
  • 23
  • 34
Alex
  • 673
  • 3
  • 9
  • 22
  • Are you sure that this SystemEmail is loaded (with the same Namespace) .. If its the same class its not possible that you can't access the constants.. – Svetoslav Nov 26 '15 at 15:45
  • Model A is Class SystemEmail, Model B is Class System – Alex Nov 26 '15 at 15:49
  • `"Do not work"` is too vague a problem - please describe exactly whats wrong - are you getting error messages? – Steve Nov 26 '15 at 15:51
  • Because I'm using the cpanel API (through a class file, nothing on error logs) I'm not getting feedback. If I use the first way using SystemEmail:USERNAME there is no error message but it doesn't recognise the input. Any other way it says it does not recognise or the variable is not valid. – Alex Nov 26 '15 at 15:56
  • show all your SystemMail model please and also al the code when you recall this constant..not only few line .. – ScaisEdge Nov 26 '15 at 16:06

0 Answers0