POO with PHP $ _POST [closed]

1

How should a value of the super global $ _POST be entered into a class.

I have tried many ways, but to no avail. This value will be treated within the class.

    
asked by anonymous 25.05.2015 / 14:27

1 answer

0

Rescue the parameter received by the post method

$transaction_code = $_POST['transaction_code'];

Once this is done, go to the class method parameter:

PagSeguroTransactionSearchService::searchByCode($credentials, $transaction_code);

Complete example

<?php
$transaction_code = $_POST['transaction_code'];
PagSeguroTransactionSearchService::searchByCode($credentials,$transaction_code); 
    
25.05.2015 / 17:47