Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Get $superCage->post-> Name !!!!  (Read 3829 times)

0 Members and 1 Guest are viewing this topic.

FredNexus

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Get $superCage->post-> Name !!!!
« 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)
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2027
Re: Get $superCage->post-> Name !!!!
« Reply #1 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.
Logged

FredNexus

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Get $superCage->post-> Name !!!!
« Reply #2 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
 
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2027
Re: Get $superCage->post-> Name !!!!
« Reply #3 on: May 12, 2016, 03:35:49 pm »

Use:

Code: [Select]
$superCage->post->_source
To get an array of name/values.
Logged

FredNexus

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Get $superCage->post-> Name !!!!
« Reply #4 on: May 12, 2016, 07:29:42 pm »

Thanks  ;D

I didn't know '_source'

Thanks !
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.