Blogz

Recent Blogz

PHP: Removing BOM(Binary Order Mark) from given string

The Binary OrderMark(BOM) is the hidden secret code used for securing the data transfer via REST services. Commonly this BOM details available starting of each string(Commonly exist in first 3 characters). But will saving in Database or processing we no need this code. So we can strip from actual code.

PHP: Debugging decoding JSON value problems - jsondecode()

The function jsondecode() function will help convert a json formatted string into JSON object. Using this object we can access its key value pairs of JSON content. Some cases we cannot create JSON object from the string. Below are possible reasons of cannot create JSON objects.

Drupal 7: CURL HTTP request with example(drupal_http_request())

The CURL is the PHP functionality for access external website contents. Using CURL request we can get content data, content or files from any other service providing websites. In Drupal 7 the function drupal_http_request(), will help to achieve CURL request for us.

A pull down effect (pull-to-refresh functionality) to load asynchronous data in ionic 2.

We are going to use "ion-refresher" which comes by default in Ionic. This can be achieved by adding the "ion-refresher" as a child to the "ion-content" HTML. Create a callback function for "ionRefresh" at the respective typescript file. The pulling icon and the spinner is provided by default at the refresher.

Drupal 8: Programatically create Add another field - Example

In Drupal for form fields we able to capture multiple values by specifying unlimited values in manage fields. A similar manner for custom fields added in form alters also able to capture multiple values. The below is the example of creating multiple value capture field with add another button.

Drupal 8: Accessing Node values and properties by loading

The node object is loaded by the function load() of Node class of core Drupal system. The object of the node will hold the pieces of information like Content type, created timestamp, author and revision values. Similarly we able to access node field values. The below is the example accessing the Node properties field values of the node.

Drupal 8: Adding custom CSS to form or page

The Drupal we can able to add custom CSS files to our forms. In Drupal 8 adding custom, CSS files will be achieved by using the library to system. The library files are needed before adding to form. These libraries descriptions are added in MODULE_NAME.libraries.yml files. Once libraries added we can able to define in our forms.