简体   繁体   中英

issue with php 7.2 and laravel

iam work with php 7.2 and laravel

 $form_data = [ 'sendto' => $response->address, 'amount' => $transaction->btc_amo, 'code' => $code, ]; 
and this is the .blade.php

  <h3> {{trans('site.blockchain.send')}} <span style="color:red">{{ $form_data[amount]}} </span>BTC <br> {{trans('site.blockchain.to')}} <span style="color:red">{{ $form_data[sendto]}} </span> </h3> <br> <br> <h2>{{trans('site.blockchain.scan')}}</h2> {!! $form_data[code] !!} <br> <br> <h3 style="color: red;">** {{trans('site.blockchain.confirmations')}}</h3> 

i have tried all things and not worked

this error appear

Use of undefined constant sendto - assumed 'sendto' (this will throw an Error in a future version of PHP)

please help

Your code is wrong, you are missing quotation marks. So it is trying to access the value of the array using a constant as the key, rather than a string. The below should work.

  <h3> {{trans('site.blockchain.send')}} <span style="color:red">{{ $form_data['amount']}} </span>BTC <br> {{trans('site.blockchain.to')}} <span style="color:red">{{ $form_data['sendto']}} </span> </h3> <br> <br> <h2>{{trans('site.blockchain.scan')}}</h2> {!! $form_data['code'] !!} <br> <br> <h3 style="color: red;">** {{trans('site.blockchain.confirmations')}}</h3> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM