telsiin Posted October 25, 2009 Share Posted October 25, 2009 Ok this has probably been asked before ,so if it has can you please point me the right direction I am attempting to convert a PayPal button in to a class but I am not too familiar with OOP So I have this from Micah Carrick IPN Integration Class $p->add_field('cn', 'Add special instructions to the seller'); $p->add_field('no_shipping', '2'); $p->add_field('bn', 'PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted'); this the html code I need to convert to add to class <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> $p->image('submit', 'src','https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif'); Link to comment https://forums.phpfreaks.com/topic/178911-oop-syntax-for-setting-the-input-typeimage-for-paypal-button/ Share on other sites More sharing options...
trq Posted October 25, 2009 Share Posted October 25, 2009 The Micah Carrick IPN Integration Class is not part of php, I'm not sure what exactly you want help with? Considering your using some third party class, you might be best to seek help from said third party. Or, at very least, post the add_field() method. Link to comment https://forums.phpfreaks.com/topic/178911-oop-syntax-for-setting-the-input-typeimage-for-paypal-button/#findComment-943887 Share on other sites More sharing options...
telsiin Posted October 25, 2009 Author Share Posted October 25, 2009 I am trying to learn the syntax so I can create and/or modify a class for creating a button however I don't know how to set the different form element and their attributes in class syntax On this page http://vailo.wordpress.com/2008/09/04/the-php-form-class-one-becomes-two/ they show example for the syntax for check box and text but not the image or radio and they don't give and example for the syntax for the different attribute such src,border,alt,. etc Link to comment https://forums.phpfreaks.com/topic/178911-oop-syntax-for-setting-the-input-typeimage-for-paypal-button/#findComment-943891 Share on other sites More sharing options...
trq Posted October 25, 2009 Share Posted October 25, 2009 Check boxes, text boxes, images, radio buttons are all html. There is no php syntax for creating them because they are client side elements. All php does is outputs strings. Now, once again you are pointing to a third party class. Some type of form class. All this form class does is outputs strings (which happen to be strings of html to create forms + whatever else it does). Being a third party class, you will need to read the docs on the class itself, it is not part of standard php. Link to comment https://forums.phpfreaks.com/topic/178911-oop-syntax-for-setting-the-input-typeimage-for-paypal-button/#findComment-943895 Share on other sites More sharing options...
telsiin Posted October 25, 2009 Author Share Posted October 25, 2009 So this ("->add_field" or "->addField")is not consider a php method or reserved word used in php syntax with setting a class ? Link to comment https://forums.phpfreaks.com/topic/178911-oop-syntax-for-setting-the-input-typeimage-for-paypal-button/#findComment-943905 Share on other sites More sharing options...
trq Posted October 25, 2009 Share Posted October 25, 2009 Nope, add_field() is a method of the third party class you are using. Link to comment https://forums.phpfreaks.com/topic/178911-oop-syntax-for-setting-the-input-typeimage-for-paypal-button/#findComment-943907 Share on other sites More sharing options...
telsiin Posted October 25, 2009 Author Share Posted October 25, 2009 ok I found that it was a custom function function add_field($field, $value) { // adds a key=>value pair to the fields array, which is what will be // sent to paypal as POST variables. If the value is already in the // array, it will be overwritten. $this->fields["$field"] = $value; } I thought it was something specific to class I learn something every day Link to comment https://forums.phpfreaks.com/topic/178911-oop-syntax-for-setting-the-input-typeimage-for-paypal-button/#findComment-943912 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.