1. gnsbud
  2. RO CSVI
  3. Friday, 20 March 2015
  4.  Subscribe via email
Hi,

I'm trying to write small csvirules plugin. In "replace" plugin I can see comment:
* @param   array   $fields    All fields used for import/export


how can I access keys and values in $fields array? No matter what I try, returning message is the same:
Cannot use object of type CsviHelperFields as array


Best regards,
Chris
Accepted Answer Pending Moderation
Hi,

nevermind, did something like:
$fields->getData()

then I was able to access $fields as an array.

Best regards,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hello Chris,

Ah, the $fields docblock is incorrect. It is indeed no longer an array but a class. You can also use:
$fields->getFields();
to just get the fields. Thanks for posting your findings.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 2
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!