Category: PHP Frameworks
CakePhp | beforeSave and afterSave Callback Methods
beforeSave(): This function is called automatically before every save or update operation. This function must return true if you want to continue save process. The data for save, if needed in this function, will be in $this->data. Syntax: class MyModel
PHP | What is the purpose of data filtering in PHP?
Data Filtering is required in PHP to validate input and sanitize input received. Generally, we need to validate data before inputs need to be saved or used in our webpage. Wrong data inputs may cause exceptions or erroneous state in
PHP | Short introduction to traits in PHP
In PHP, the trait is a method of code re-usability. Php is single inheritance programming language. So there is a limitation of code reusability due to single inheritance. Traits in PHP is basically a method of code reusability. Traits have
Moodle | Uploading Scorm Package and some internal function calls
1.Uploading a scorm package (.zip) in moodle: a. Log-in to moodle, navigate to your course and “turn editing on”: b. Click “Add an activity or resource” link: c. Select Scorm package from list and click Add button: d.Add basic information
PHP | Password hashing
Password hashing is the new recommended way to store the password using hashing method (PHP 5 >= PHP 5.5, PHP7). Password hashing is used to encrypt the password similar to the way md5, sha1, sha256 etc do. But this method
Selenium | Take UI screenshots when script is executed
During testing a website with Selenium, function given below can take screenshot that can help us in cases like when testcase fails and we need the screenshot to see what happened on UI. Here is function to take screenshot: public
AWS Amazon CloudFront – How to enable cache for whole site
AWS Amazon CloudFront is a web service that speeds up serving static and dynamic web content like, .html, .css, .php, and image files and videos. It also integrates with other Amazon Web Services like S3, EC2, Elastic Load Balancer and
PHP | Load Data Infile to insert csv data into Mysql with PHP
Problem: How to insert csv data into mysql table with mysql query in php. What problems usually you face with this and how to resolve them. Description: I have csv file with thousands of records. I want to insert these
Moodle/Totara | Creating a new Activity Plugin
Introduction: In Moodle/Totara we can add a different type of activities to a course by selecting from the list of standard activities available. As shown in the the list below: But there might be some cases in which we need
