私がそれを尋ねている理由は、次のビューに渡したい小さなばかげたメッセージに腹を立てているからです。だから私は:
if(!$this->paypal_pro->APICallSuccessful($PayPalResult['ACK']))
{
var_dump($PayPalResult['ERRORS']);
$message=array();
foreach ($PayPalResult['ERRORS'] as $row => $error){
// $message['flashError'][$row]['L_SHORTMESSAGE'] = $error['L_SHORTMESSAGE'];
$message['flashError'][$row]['test'] = "The Session class permits you maintain a user's";
// $message['flashError'][$row]['L_ERRORCODE'] = $error['L_ERRORCODE'];
// $message['flashError'][$row]['L_LONGMESSAGE'] = $error['L_LONGMESSAGE'];
}
// print_r($message);
$this->session->set_flashdata($message);
redirect('main/Form');
}
それはうまくいきますが、もしそうなら:
if(!$this->paypal_pro->APICallSuccessful($PayPalResult['ACK']))
{
var_dump($PayPalResult['ERRORS']);
$message=array();
foreach ($PayPalResult['ERRORS'] as $row => $error){
// $message['flashError'][$row]['L_SHORTMESSAGE'] = $error['L_SHORTMESSAGE'];
$message['flashError'][$row]['test'] = "The Session class permits you maintain a user's and track their activity while";
// $message['flashError'][$row]['L_ERRORCODE'] = $error['L_ERRORCODE'];
// $message['flashError'][$row]['L_LONGMESSAGE'] = $error['L_LONGMESSAGE'];
}
// print_r($message);
$this->session->set_flashdata($message);
redirect('main/Form');
}
うまくいきません。
ここでは、 main/form に falshdata を表示しています:
<?php if($this->session->flashdata('flashError')):?>
<div class='flashError'>
<?php
print_r($this->session->flashdata('flashError'));
?>
</div>
<?php endif?>
エラー処理のビューに Payal のエラー メッセージをプルしようとしていると推測できます。ありがとう