Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Have you ever output a $form array?  (Read 1010 times)

Offline dhigz

  • Newbie
  • *
  • Posts: 27
  • Karma: +8/-0
    • View Profile
    • My AbanteCart Site:
Have you ever output a $form array?
« on: August 02, 2016, 01:40:40 AM »
Have you ever output a form array? (print_r(array_values($form))) I did. It's huge as every element has the entire registry in the array.

If you want to try it, be careful as it will eat up your memory. Make a form with one form element just to see.

So AbanteCart gurus, can you tell me why every form element includes the entire registry as one of it's array values? There must be some valid reason to have all of this overhead every time you output a form.

Don Higbee

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1692
  • Karma: +223/-10
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Have you ever output a $form array?
« Reply #1 on: August 02, 2016, 05:41:41 AM »
every form field element is an object, not array!
Do output it use type casting. for ex. var_dump( (string) $form['fields']['some_field_name']));

“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens Prom dresses 2018