「オブジェクト コンテキストでないときに $this を使用しています」というエラーが表示され続けます
インスタンス化。
$axre = new Axre();
if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)){
echo "yes";
} else {
echo"no";
}
オブジェクト コンテキストを取得するにはどうすればよいですか?
$email で保護されています。フォーム上にあるため、保護する必要があります。
// このフレームワークのほとんどのオブジェクトは、コンストラクターを呼び出すことによって設定されますが、 // これにはさまざまなエントリ ポイントがあります。
class Axre extends Base {
protected $email;
protected $user_name;
protected $temp_token;
protected $sign_in_token;
protected $UserShoppingList;
function __construct($email = null) {
if (strpos($email, '@') === false) {
$this->sign_in_token = $email;
} else {
$this->email = $email;
}
}