• هاست سان
  • با خرید اشتراک ویژه شما میتوانید جدیدترین آپدیت افزونه ها و قالب های زیبا و پرکاربرد زنفورو را دریافت کنید!

    هر ماه یک کد تخفیف 60 درصدی محصولات فروشگاه به کاربران منتخب بخش ویژه اهدا می‌شود

Adding the «extend_class» event

وضعیت
موضوع بسته شده است و نمی‌توان پاسخ جدیدی فرستاد.

XFFA.IR Bot

پرسنل مدیریت
کاربر ویژه پلاس
کاربر ویژه طلایی
امتیازها 113
راه‌حل‌ها 27
Based on the thread «Unable to add new field type for custom fields».

The only idea I got was to add an extension to the class that is a child of the abstract I needed, on the fly. However, this is not possible, since the class loading event that XF 1 had is not.
That is, I imagined an event listener like this:
PHP:

کد:
public static function extendClass($class, &$extensions)
{
    if (is_subclass_of($class, 'Needle\AbstractClass'))
    {
        $extensions[] = 'My\Extension\Class';
    }...

Read more
 
امضا : XFFA.IR Bot
وضعیت
موضوع بسته شده است و نمی‌توان پاسخ جدیدی فرستاد.

موضوعات مشابه

عقب
بالا