ما هو customer.form.register.fields.before ولماذا تضيف هذه الكتلة إلى customer_account_create؟

magento.stackexchange https://magento.stackexchange.com//questions/48047

سؤال

<reference name="content">
        <block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
            <block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
                <label>Form Fields Before</label>
            </block>
        </block>
</reference>

سؤالي هو ما هو customer.form.register.fields.before ولماذا تضيف هذه الكتلة فيcustomer_account_create> و

<?php echo $this->getChildHtml('form_fields_before')?>

ما يظهر هذا الرمز في أتش تي أم أل صفحة.

هل كانت مفيدة؟

المحلول

افتراضيا هذا لا يفعل شيئا.
ولكنه موجود حتى تتمكن من إضافة بيانات مخصصة قبل حقول التسجيل.
إنه بمثابة حاوية حيث يمكنك وضع الأشياء الخاصة بك فقط باستخدام ملفات التخطيط.
لنفترض أن لديك هذا في أحد تخطيطاتك.

<customer_account_create>
    <reference name="customer.form.register.fields.before">
        <block type="[module]/block_name" template="some/template.phtml" name="some_name" as="some_alias" />
    </reference>
</customer_account_create>

ثم الكتلة [module]/block_name سيتم تقديمه بواسطة القالب some/template.phtml أعلى حقول التسجيل دون أي تغيير في قالب تسجيل العملاء نفسه/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top