Exposed Filter Field #weight has no impact on ordering

Is there a way to change the order of exposed filter fields by hook_form_alter'ing their weights? I'm trying to add a few new form elements with hook_form_alter and can't get them to show up anywhere except the end of the for. The other alternative I come up with is perhaps a plugin that just adds... Continue Reading →

Advertisements

HTML5: Changing the browser-URL without refreshing page

An often overlooked feature of HTML5 is the new “onpopstate” event. This new feature offers you a way to change the URL displayed in the browser* through javascript without reloading the page. It will also create a back-button event and you even have a state object you can interact with. This means you won’t have... Continue Reading →

WEB CACHE: APC VS MEMCACHED VS VARNISH

With increasing amounts of data and server-side processing, caching systems are as important as ever. There are so many varieties of these systems out there, it can be confusing if you don’t understanding the different nuances. Worse yet, if you pick the wrong caching system for your needs or fail to optimize it correctly, the... Continue Reading →

Query time result in MySQL w/ PHP

$starttime = microtime(true); //Do your query and stuff here $endtime = microtime(true); $duration = $endtime - $starttime; //calculates total time taken This will give you the run time in microseconds.

Type hinting in php

With Type hinting we can specify the expected data type (arrays, objects, interface, etc.) for an argument in a function declaration. This practice can be most advantageous because it results in better code organization and improved error messages.It will also explain the subject of type hinting for basic data types (integers, floats, strings, and booleans)... Continue Reading →

Overloading in php oops

Overloading is defining functions that have similar signatures, yet have different parameters. Overriding is only pertinent to derived classes, where the parent class has defined a method and the derived class wishes to override that method. In PHP, you can only overload methods using the magic method __call. An example of overriding: <?php class Foo... Continue Reading →

Differences between abstract class and interface in PHP

Following are some main difference between abstract classes and interface in PHP In abstract classes, this is not necessary that every method should be abstract. But in interface every method is abstract. Multiple and multilevel both type of inheritance is possible in the interface. But single and multilevel inheritance is possible in abstract classes. The method of PHP interface must... Continue Reading →

What is Interface in PHP OOPS ?

Interface in oop enforce definition of some set of method in the class. By implementing interface you are forcing any class to must declaring some specific set of methods in oop. For example if you are creating class to render HTML element then it is necessary to set id and name of your html tag. So in this case... Continue Reading →

What is abstract Classes

As from name it seem like something that is hidden. Yes nature of the abstract classes are same. Abstract classes are those classes which can not be directly initialized. Or in other word we can say that you can not create object of abstract classes. Abstract classes always created for inheritance purpose. You can only inherit abstract... Continue Reading →

Insertion Sort example and algorithm

Sorting is the process of arranging a list of elements in a particular order (Ascending or Descending). Insertion sort algorithm arranges a list of elements in a particular order. In insertion sort algorithm, every iteration moves an element from unsorted portion to sorted portion until all the elements are sorted in the list. Step by... Continue Reading →

WordPress.com.

Up ↑