Category: PHP Frameworks
Add virtual field in cakephp 2.* in find methods
How to specify an extra field (not existing in the table) while fetching data from database using find method? Solution is explained below. Assign value to virtual field before find function call: $this->virtualFields[‘virtual_field_name’] = ‘any value’; Use virtual field in
Allowing PHP cURL to access self-signed websites without verifying the SSL certificate
By default, each cURL request can access only SSL certified websites. However, at times it is required to access those sites which are self-signed. To verify that your cURL request is able to access self-signed websites or not, use below
WordPress | Developing Custom scheduler in WordPress
Suppose you want to design a custom scheduler in wordpress plugin instead of using wordpress scheduler which has fixed values of recurrence which are ‘hourly’, ‘twicedaily’,’daily’. And if you want to make the scheduler dynamic instead of making it static
PHP | Only first word showing in textbox from assigned sentence
Problem: After the first space in the string no data appears in the input field. There is an issue when a string contains words with spaces and we want to display the whole string in an input field but after
Adding custom merge tags to the Gravity forms
Merge Tags in gravity forms are the tags that are used to dynamically populate the field values in the form content in gravity forms like IP address, browser name, logged in user name etc . There are many merge tags
WordPress | How to retrieve query variables in plugins
Suppose the URL contains query string for example www.mywebsite.com/sme_page?q=12 then the value of query variable can be retrieved in PHP using the get method such as: <?php echo $_GET[‘q’]; ?> While creating a plugin for WordPress, to retrieve a
CakePHP 3.x | How to change URL of your website to hide controller/action name
Requirement: While running the website in browser, the url path shows controller name followed by the action name and parameters list. In that case the url looks like: www.xyz.com/User/showDetails/ We may come across two types of requirements. Displaying only the
Ubuntu | Remove sendmail completely
Problem: I installed sendmail in my ubuntu system with the help of link http://lukepeters.me/blog/getting-the-php-mail-function-to-work-on-ubuntu. I installed it to test php mail functionality on localhost for my project. It was working slow, therefore, after testing, I wanted to uninstall it completely
Moodle | Calling custom function on an event
Event driven architecture is inbuilt into Moodle. There are various kinds of events present in moodle like: 1. Course completion 2. Course creation 3. Course deletion 4. Course Module creation 5. Category Creation etc. On trigger of an event we