Spring is arguably one of the most popular Java frameworks, and also a mighty beast to tame. While its basic concepts are fairly easy to grasp, becoming a strong Spring developer requires some time and effort. In this article we’ll cover some of the more common mistakes in Spring, specifically oriented towards web applications and Spring Boot.
The below is the sample code for strip a particular HTML element from given string HTML. Using this function we can able to get particular div, span, p, body, article,.. any HTML wrapped element by its class or id. This function accepts 4 parameters, HTML string to get particular Tag, Strip tag name, Identifier name Class or Id and Identifier Class name or Id name.
Rules are used for trigger any action based on some condition pass. The contribute module Rule is used to achieve this features. We can able to programatically create and update rule action and conditons. The function rules_config_load() helps to load rule object by its name. The rule object will return attributes of particular rule. Using the object of rule we can able to edit its values.
In Drupal commerce will help to convert any numbers into a proper currency format. The function commerce_currency_format() helps to convert decimal numbers to particular country formatted currency. This function will accept a decimal number and country currency code for change given number into currency.
The MySQL database query supports aggregate functions to retrieve values from the database. In our custom query, we can able to add aggregate queries. The function addExpression() takes object of database query to aggregate results in db_select(). The below example will demonstrate the usage of aggregate functions.
The MySQL is the database which stores any type of data in Database. Using the MySQL we can able to store date-related fields. The MySQL will support Date functions to retrieve and format database date field values. In Drupal also we can able to add date functions in our queries with help of where() function in the database object. The below is the syntax and example of usage of the where() function.
In PHP we can able to slice an Array into small chunks. To chunk array, there is a function called array_slice(). This function will accept splitting array with Limit and offset of the slice. It will split array into given limit from the offset of starting.
Magento is currently the largest open-source eCommerce platform in the world. Due to its feature rich and extensible code base, merchants with large and small operations all around the world have been using it for a wide variety of projects.
Drupal system makes blocks is cachable to speed render. The block cache is stored in Drupal core database block_cache table. By altering or change information of block as non-cachable. This is achieved by passing cache as "DRUPAL_NO_CACHE" in hook_block_info() for custom block and hook_block_info_alter() in existing block.
Blocks are the data or content holders in Drupal. We can able place block in any region of our Drupal site. The main advantage of the block is can place any pages. We can able to create custom blocks via Configuration and coding wise. The below is the steps to create custom blocks in Drupal 7.