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

Offline dhigz

  • Newbie
  • *
  • Posts: 43
  • Karma: +16/-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: 1979
  • Karma: +303/-12
  • 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


Powered by SMFPacks Social Login Mod