PHP

How to create model in CodeIgnitor?

Hello Friends, Today we will discuss model creation in CodeIgnitor. First of all, we will create a model file in \ci\application\models\ folder. Suppose model file will be named as User_model.php and the class name will be User_model and after that create the constructor of the class who will be call the parent class constructor. Now We will create a method for deletion of the system user from the system_users table…
Read more

Linking to CSS, JS and Images in Laravel

For linking to the CSS, Javascript and images files, we need to install a package and package name is LavavelCollective. Open your system terminal and browse to the laravel project folder.

Package will be installed using the composer and we need to run below command on the terminal.

After run above command the package will be install into our laravel project. For verify that the package is installed…
Read more

Install PHPUnit and run unit test cases

Hello Guys, Today we will discuss the PHPUnit and try to make a program to perform unit testing using PHP Language. PHPUnit is complete unit testing framework written in the PHP Programming Language and was written by Sebastian Bergmann. It allows to PHP programmers to perform unit testing and practice test driven Development(TDD). For installation of the PHPUnit on Linux based system like on Ubuntu, I used following steps


Read more

What are PSR Standards ?

Hi Guys, The PHP Standard Recommendation (PSR) is a PHP specification published by the PHP Framework Interop Group.The aim is to enable interoperability of components and to provide a common technical basis for an implementation of proven concepts for optimal programming and testing practices. The PHP-FIG is formed by several PHP frameworks founders. Number Name Description Status PSR-0 Basic Coding Standard It describes the mandatory requirements that must be adhered…
Read more

Storing Session data into MySQL database

Hi Guys, Today we will discuss on store PHP session data into MySQL database. Its most critical part of the application when our application runs on the shared server and session data is hijacked or injected harmed by an attacker. So we need to be careful on this. Everyone knows that my session data is stored by default into the /tmp folder and this is writable by all users. For…
Read more

Factory Design Pattern using PHP

Hi Guys, Today we will discuss on the Factory Design Pattern using PHP. It’s most common design pattern and it’s mostly implemented by most of the frameworks and applications. Basically we will first create an Abstract class that will have functions declared in it.

Now I will create MySQLManager class first and it extends from the above class AbstractDatabase and will implement in the above-declared class functions here.


Read more

Pass by reference in function

Hi Friends, Today we will discuss the how to passing data by reference using the PHP. When we pass the parameters to the functions as the reference then it manipulates the reference faster. It happens only because when we pass by value then it creates one more copy of the value is getting created. So try to make practice as passed by reference and for that, you only need to…
Read more

Zend Framework Call Different layout

Hello Guys, If I am working on the Zend Framework project and a by default layout is set for all the controllers/action. If I want to set another layout for one of my action then I will call this code in my action.

Suppose I have admin-layout.phtml layout and I want to call in my action then I will use this code.

Error Reporting in PHP

Basically when our application is LIVE then we don’t want to show any error/warning on the screen if it will show on the screen it will make a bad impression in front of a client and we doesn’t want to loose our credibility at any cost. So we need to disable the errors showing on the screen of a user and need to logged those errors/warnings information so that we…
Read more

Optimization WordPress Plugins & Solutions by W3 EDGE