Wednesday, 15 January 2014

php - Paypal button generation in Yii? -



php - Paypal button generation in Yii? -

i have script "paypal button":

<script async="async" src="https://www.paypalobjects.com/js/external/paypal-button.min.js?merchant=asdfsdaf@sda.ru" data-button="buynow" data-name="<?=php echo yii::app()->user->id;?>" data-quantity="1" data-amount="3" data-currency="usd" data-shipping="0" data-tax="0" ></script>

the database table "payments" , field "content" html code generated in form. button displayed, data-name: display "user->id.?>" not user id. ie php not interpreted. prompt how insert user name in field in form?

in view, info displayed this:

<?="<div>".$model->text."</div>"?>

syntax error!

<script async="async" src="https://www.paypalobjects.com/js/external/paypal-button.min.js?merchant=asdfsdaf@sda.ru" data-button="buynow" data-name="<?php echo isset(yii::app()->user->id) ? yii::app()->user->id : '';?>" data-quantity="1" data-amount="3" data-currency="usd" data-shipping="0" data-tax="0" ></script>

php yii paypal

No comments:

Post a Comment