forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: FredNexus on May 12, 2016, 02:55:55 pm

Title: Get $superCage->post-> Name !!!!
Post by: FredNexus on May 12, 2016, 02:55:55 pm
Hello,

I need to assign to a var a post value but I do not know it's name !  :-\

$my_var = $superCage->post->getEscaped('I do not know the name');  :o

I would like to know if it's possible to detect the name of the $superCage->post ??

Thanks

Nexus 8)
Title: Re: Get $superCage->post-> Name !!!!
Post by: ron4mac on May 12, 2016, 03:15:07 pm
Temporarily insert this in your code:

Code: [Select]
echo'<xmp>';var_dump($superCage->post);echo'</xmp>';
It will display what values there are.
Title: Re: Get $superCage->post-> Name !!!!
Post by: FredNexus on May 12, 2016, 03:21:45 pm
Thanks  ;D

I know this solution to debug.

I looking for a production solution.

It's to not have to write 500 $superCage->post->keyExist to check what value's name is send to.  ;D

Thanks
 
Title: Re: Get $superCage->post-> Name !!!!
Post by: ron4mac on May 12, 2016, 03:35:49 pm
Use:

Code: [Select]
$superCage->post->_source
To get an array of name/values.
Title: Re: Get $superCage->post-> Name !!!!
Post by: FredNexus on May 12, 2016, 07:29:42 pm
Thanks  ;D

I didn't know '_source'

Thanks !