Category: PHP Frameworks
Zoho | Create Zoho Subscription using the PHP and subscription API
We can create new Zoho Subscriptions via code by using PHP curl and with the help of Subscription APIs. Below is the sample code which is required to create a subscription: $headerArray = array(“Content-Type: application/json;charset=UTF-8”, “X-com-zoho-subscriptions-organizationid: 00000000”, “Authorization: Zoho-authtoken ——–Auth
PHP | Use Of strtr() function
In PHP if you want to replace multiple variables of the string at one go you could use strtr() instead of using str_replace(). Example : $vars = array( ‘##session_date##’=>$sessiondate, ‘##session_time##’=>$sessiontime, ‘##conferencelinenumber##’ =>$conferencelinenumber, ‘##pincode##’ =>$pincode, ‘##coachingcommnets##’=>$coachingcomments, ‘##actioncommitmnets##’=>$actioncommitmnets, ‘##reminders##’=> ‘ ‘, ‘##name##’
CakePHP | How to skip CakePHP authentication for some controller methods
Description: By default, CakePHP authentication is applied to all application controllers. So it does not allow users to perform any of the action without login. Solution: Each controller has a beforeFilter method which runs when some action is called from controller.
PHP | Header function not working
Code : Function getredirect($subcontactid) { echo”contactid”.$subcontactid; header(“location:https://subscriptions.zoho.com/app#/customers/$subcontactid”); exit; } The header function in the above code does not work. But when we remove the echo from the code, it works properly. Code after removing echo : Function getredirect($subcontactid) { header(“location:https://subscriptions.zoho.com/app#/customers/$subcontactid”);
Generate getter/setter for PHP Classes in Eclipse
Using PHPGen Eclipse plug-in one can automatically generate getter /setter methods for instance variables. Note: This Plugins is not available in Eclipse Marketplace. Steps For Installation: Start Eclipse and add “Help> Install New Software” from following URL: http://loge5.de/downloads/Eclipse/: Click Add,
How to use SimpleSAMLPhp as a Service Provider for authenticating users?
How to use SimpleSAMLPhp as a Service Provider for authenticating users? Some Basic steps to start using simplesamlphp. 1. Download stable version of SimpleSAMLphp from this link: Click here 2. Go to the directory or your workspace where you want
CakePHP | Using Elements for common code
Problem: How to separate redundant piece of code from your view using cakephp 3.0. Description: Let’s take an example. You have a list of products to display. We show products at many places such as 1. Show all products. 2.
PHP | Rename all the files in zip and then extract zip in PHP
Description: In one of our PHP projects, we wanted to rename all the files in zip folder and then extract the zip. The code for this is written below : $zip = new ZipArchive; $res = $zip->open($sourceFolder.’\’.$file); for ($i =
Moodle | New lang strings not accessible
In Moodle we had declared some new strings in lang file of a plugin like this: $string[‘LIBRARY_NAME’] = ‘E-Lab’; $string[‘BOOK_READ_SUCCESS’]=’Congratulations on reading the book’; We wanted to use it in view.php file of the plugin like this: $result=Get_String(‘BOOK_READ_SUCCESS’, ‘plugin name’);