Featured
-
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Best 5 Lightweight PHP Frameworks for REST APIs Development
Are you ready to develop the Rest AP
by ankur.kumar -
PHP: Full-Stack Framework vs Micro Framework
A web framework can be described as a software fra
by ankit.bhatia -
How to get facebook profile picture by Facebook App
If you would like to get your profile picture in f
by vivek.rastogi -
Creating RESTful API in cakephp
This tutorial will help you to learn how to create
by pushpendra.rawat
Tags
Controlling visiblility of blocks in Drupal 7
Go to Structure -> Blocks Here you can fill the information regarding a block like,
Block Title (you can override the default title for the block. Use to display no title, or leave blank to use the default block title. This field suppor...
How to the use file_get_contents() in PHP ?
Welcome to findnerd, today we are going to discuss How the use file_get_contents() in PHP ?
Fistly let know what is use of file_get_contents() ?
The file_get_contents() basically reads a file into a string.
So we can say that file_get_con...
What is procees to print HTML page with tags using PHP ?
Hello all welcome to findnerd, today we are going to discuss How to print HTML page with tags using PHP ?
The htmlspecialchars() Function is very useful print HTML page with tags using PHP
Firstly let know what does htmlspecialchars() Func...
How to fetch all data from model in cakephp 2.x
In cakephp it allows a beautiful feature that helps in fetching all the data of the Model and set on the view.
The fetching can be done in cakephp with the find method and the set function is used to set the data on the view.
The find method ca...
cal_days_in_month() function in PHP
cal_days_in_month() function is a PHP calendar function. This function always return number of days in a specified calendar for month of year .
Syntax is : -
cal_days_in_month ( $calendar, $month, $year );
parameter are : -
...
How to convert given digits to words using PHP
Hello Reader's! If you have given digits of number and you want it to convert into words for example 76 will be converted as seventy six and 102 will be convert as one hundred two
Lets see the function below:-
<?php
function digitti...
How to get file information using PHP
Hello Reader's If you want to get the full path , name or the directory of a file using php then you can use the code below:-
Let's see the example below:-
function filePathParts($arg1) {
echo $arg1['dirname'], "\n";
echo $arg1['bas...
How to make custom session timeout in php
Hello Reader's!, If you want to make the custom php session which will destroy automatic then you can use the code as below:-
session_start(); // ready to go!
$now = time();
if (isset($_SESSION['discard_after']) && $now > $_SESS...
How to validate url in php
Hello Reader's! If you have a url given and you want to check weather it is valid or not. For example www.facebook.com is a valid but www.fcebook.com is invalid link.
By using you can do this by Curl function, Lets see the example below:-
f...
How to integrate PHP Mailer
Hello Reader's!
If you want to send email some other than php mail then php mailer is the best option. PHPMailer provides an object oriented interface, but in case of php mail() is not object oriented. Let's see how to integarte php mailer funct...
Load cakephp component on fly
In cakephp we load component by using code
public $components = array('Custom');
but we might not need this in all actions so we can load this component on fly under actions for example
public function test(){
$this->Customr = ...
Email template in cakephp
Cakephp provides simple way to send email. The templates for emails resides in a view directory folder called emails. Email views can also use layouts.
$Email = new CakeEmail();
$Email->template('myemail', 'mylayout')
->emailFormat...
Send email in cakephp
First create configuration file name as email.php inside app/config/email.php and setup different config options here.
public $default = array(
'transport' => 'Mail',
'from' => array('fromname@email.com' => 'kshitiz dixit'...
Drupal Global Theme Configuration
Global Theme Configuration
I am asuming this is the fresh installaiton of drupal.
From the menu bar click on Appearance you would see that Bartik is selected as the default frontend and seven is the Administrative theme,
Where to change...
Get the Current Page URL
To get the current page url please check the below php script.
In the below script we define a function named as currentPageURL( ). Then we have created a variable named as $PageURL having value http. Now we are using the PHP superglobal varri...
Overwrite Additional Image Sizes of parent in child theme Wordpress
Hello users, today I teach you How to Overwrite Additional Image Sizes of parent in child theme Wordpress.
Below code is the Parent theme for image cropping.
add-action( 'after-setup-theme', 'setup' );
function setup()
{
add-image-...
JSON data insert into MySQL using PHP
We can insert the json data in to mySQL using php .please see the below example for processing json data to mySQL.
Example : -
Suppose we have a file having json data like below -
{"FirstName":"ravi", "LastName":"srivastva"}
...
Remove Parent theme Shortcodes in Child theme Wordpress
Hello Everyone, I am here to discuss about "Remove Parent theme Shortcodes in Child theme Wordpress".
You can just copied mine code and put into child theme functions.php file
function remove-parent-theme-shortcode() {
remove-shortcod...
Drupal Core Base Theme Features
As I mentioned in my previous blog that Drupal 7 is shipped with four default themes, listed below
Bartik
Garland
Seven
Stark
I would like to share some useful features of default themes
Bartik...
how to create custom helpers in cakephp
Helpers is a classes which contains presentation logic that is shared between many views,layouts and elements.
First need to create helper file which must be stored inside app/Helper/EntriesHelper.php
App::uses('AppHelper', 'View/Helper');
...
How to remove parent widget and sidebar in child theme wordpress
Hello Everyone, In this blog I teach you How to remove parent widget and sidebar in child theme wordpress.
Below code is the parent theme sidebar code.
class PWidgetName extends WP-Widget {
// your widget code
}
You can remove this...
Creating custom component in cakephp
Cakephp provides number of core components such as Session,cookie ,email etc. Component extends the object class. It allow us to reuse the code and makes our controller code clean. Use camelcase naming convention while creating component.All co...
The default Drupal themes
There are four default themes included with Drupal 7
To view available themes, log in to your site as an administrator then click on the Appearance link on the Toolbar. The Theme Manager displays a list of all the themes installed ...
How to maximise the maximum size of POST in PHP ?
Welcome to findnerd, today we are going to discuss How to increase maximum size of POST in PHP ?
If you want to increase the size of POST for sending much more POST request, then you have to follow bellow given point.
There are 2 different ...
Drupal Theme, Regions, Block
What is a theme
In the relation of Drupal, the term "theme" means a collection of inter-related files that are responsible for the look and feel of a Drupal website
One of the key advantages of Drupal's architecture is the ability to obstruc...
Creating template in Joomla
Two files are required to create a template in Joomla. First is the index.php file, in this file we can place php code where the content of site should go and second file is templatedetails.xml which includes all the configuration settings and pa...
Remove parent theme menu in child theme Wordpress
Hello Everyone, I am here to teach you how to remove parent theme menu in child theme wordpress.
The below code is in your parent theme for register the menu.
add_action( 'after_setup_theme', 'register_themename_menu' );
function registe...
Magic Methods and their types
Php functions that starts with double underscore are called magic methods.These functions are not stand alone functions and are defined inside class. Php will call these functions from background means behind the scenes. It is not directly called...
Where to use "__construct" magic function
__construct
The constructor is a magic method, which is immidately initated after declare the object of class and you can write the __construct method at any place in the class.
Right here all of us have a case in point during which, develo...
Remove Custom Post Types and Taxonomies in Wordpress
Hello readers, In this blog I will teach you how to remove custom post type and taxonomies.
The below code is the custom taxonomies of the parent theme inside the functions.php
add_action( 'after_setup_theme', 'parent_gallery_add_post_typ...
How to return an array from a function in PHP?
If we have a function and we want to return multiple values from that function then we can easily return an array from function.Below is the example which returns a multiple array from function.
function myFunc( ) {
$myvar1 = 10;
$myvar2 =...
PHP magic function
PHP functions that start with a double underscore __ , are called magic functions in PHP.
__construct()
__destruct()
__call() __callStatic() __get() __set() __isset() __unset() __sleep() __wakeup() __toString() __invoke() __set_state() __...
How to Enable anf disable regions in theme .info file
by placing and removing semicolon(;) in front of line we enable and disable regions in theme .info file
REGIONS - ENABLED
regions[page_top] = Page Top
regions[header] = Header
regions[highlighted] = Highlighted
REGIONS - DISABLED
...
Drupal Theme Metadata
Drupal Theme Metadata
Writing a .info file is the first step when we create a Drupal theme, .info files contain important metadata about the theme, such as the list mentioned below.
name /*required*/
name = A firt th...
Drupal Views Related Top 10 Modules
Drupal Views Related Top 10 Modules
Views Bulk Operations (VBO)
Allow bulk operations to be run on the displayed rows
Views Table Highlighter
Aloow to highlight certain views table rows based on PHP code
Better...
How to pass JavaScript variables to PHP
Many a times we got stuck in a case or situation where we have to pass JavaScript variables to PHP using a hidden input in a form. The solution for this situation is:
Solution:We cannot pass variable values from the current page javascript...
How to modify(Remove) parent theme feature within child theme
Hello reader's, in this blog I discussed ablout "How to Modify(Remove) Parent Theme feature Within Child Theme".
We all know that parent theme and child theme follow inheritance.
The basic meaning of Inheritance is, child theme get the proper...
Finally block in Exception handling php
Welcome to FindNerd. We are going to discuss the finally block in php. We use it with Exception handling. Are you familiar with exception if not then check our
exception based blog Exception concept for help. finally block run always whenever co...
Convert one date format into another in PHP
Date play an important role in any project. We have to change date format according to our need. If we are using PHP 5.2 and lower then for changing date format we have to parse the elements (year, month, day, hour, minute, second) manually using...
Exception in php
Welcome to FindNerd. We are going to discuss the Exception,what is it and how we can use it in php? First question araised that what is Exception? Exception is nothing but a runtime error. It depends totally upon the values passing at run time.
...
Login with linkedin in php
Follow the below steps in order to use the linkedin API.
Go to the Apps page at LinkedIn
Developer Network and login with
your LinkedIn account credentials
https://www.linkedin.com/secure/developer
Click on the Add New Application
link...
How to Create and Use Cookies in PHP
Cookies are basically small text files that is stored in browser and it is use for tracking purpose.
Cookies are also use for remember me functionalities.
Setting Cookies with PHP
setcookie(name, value, expire, path, domain, security);
...
Pagination in Cakephp
In cakephp framework there is a way which features pagination easily on your web page.
This can be done as :
Controller Code :
public $components = array('Paginator','Flash');
public function index() {
$this->paginat...
Security in Drupal
What Basic Steps You can take to make you drupal site to make it much more secure.
Actually Drupal is configured to be secure out of the box, because it restrained it's permission, but as we extend website according to our need we get playing ...
How to redirect user with session message in Codeigniter?
Hello Reader's If you want to make user redirect and show him the error message on next page then by using codeigniter you can do by following functions:-
Let's say if user input wrong username/password then you'll redirect user by following c...
Laravel Eloquent - Attach vs Sync
Attach and Sync are the two methods which we used in our Laravel Eloquent. We can describe this as follow:
attach():
1) This is used for Insert related models. This method is used when we want to work with many-to-many relations.
2) When w...
Get all routes using Laravel 4
I have a situation where I want that every request that comes to my laravel 4 application for this I will use one controller at the moment which should handle every request. For handling this query the solution is as follow:
This is the quest...
How to make a class/method abstract in php
Here we will learn about the abstract classes and methods. When we define a classes as an abstract then we have to follow the below rules:
1- We can not create an object of this abstract class.
2- The class becomes abstract if the class conta...
Use of "Final" keyword in php
This tutorial will help us to see the use of final keyword with a method of a class and a class individually.
Example:
class parentClass {
public function test1() {
echo "This is test1 method of parentClass";
}
final...
Import & Export Category in Magento
How to import and export category in magento
If you want to add all categories of one project to your new empty project in magento, then You have to download Mage works import- export extension from the Zip File which is given in the end of th...