Nemanja on "create object inside __construct then call it in another method of same class?"

ساخت وبلاگ

Nemanja
Member
Posted 9 minutes ago #

Hi, looks I am missing something out, can someone please explain this to me. I want to create object inside __construct then call it in another method of that class?

class MyPlugin { public function __construct() { require_once(sprintf("%s/templates/class-db.php", diame(__FILE__))); $db = new Orders_DB(); } public static function activate() { $db->create_table(); }
}

not working of course, tried a lot of things, but guess I am missing some basic things here. Thanks!

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 356 تاريخ : دوشنبه 24 خرداد 1395 ساعت: 1:47