v2.5.2
Giriş yap

Call to undefined method helper::yonlendir() hatası

weisse
367 defa görüntülendi

Başlıkta gördüğünüz gibi hata alıyorum,

Fatal error: Uncaught Error: Call to undefined method helper::yonlendir() in C:\xampp\htdocs\0989283726-mooncheckv2\auth\register.php:37 Stack trace: #0 {main} thrown in C:\xampp\htdocs\0989283726-mooncheckv2\auth\register.php on line 37

					sessionManager::sessionOlustur($dizi);
					helper::yonlendir("https://xx.com");
class helper
{
	static function yonlendır($url,$sure=0)
	{
		if($sure!=0) 
		{
			header("Refresh: $sure; url =$url");
		}
		else
		{
			header("Location: $url");
		}
	}
database
837 gün önce

fonksiyonu public yapmamışsın ki düz static yazıp göndermişsin

bu verdiğim çalışacaktır

namespace App\Helpers; // artık neredeyse bu sınıfın ayrıca bunu include de etmen gerekiyor ardından kullanabilirsin

class helper
{
	public static function yonlendir($url, $sure = 0)
	{
		if($sure) return header("Refresh: $sure; url=$url");
		return header("Location: $url");
	}
}