Beware of these mistakes while coding in PHP-Part 2

Beware-of-these-mistakes-while-coding-in-PHP

Mistake 2: Forgetting to unset the reference variable after the loop.

In the previous blog of the series we started with the isset function mistake and I have promised to post about the next mistake which is leaving dangling array references after foreach loop.

While working with arrays, we need foreach to iterate over arrays. In some case, we might be just displaying each array element while iterations but in some case, we might need to manipulate or operate on each element. When there is a case, where we need to operate on each element, using references in foreach loops can be useful. See below code snippet.

Continue reading
0
  1406 Hits
  0 Comments
1406 Hits
0 Comments

Beware of these mistakes while coding in PHP

Beware-of-these-mistakes-while-coding-in-PHP
As a PHP developer, I am sure we all write some lines of code every day where we use library functions, creates new functions, Writes for, for each loop and also we use some statements and many more things that we need to do for solving a problem by PHP. Do we use the right library functions in the right place? Do we write correct loops? In my opin...
Continue reading
0
  2396 Hits
  0 Comments
2396 Hits
0 Comments

Some JavaScript code snippets in Joomla worth keeping in your stash

Some-Joomla-Javascript-Code-Snippets-Worth-Keeping-in-your-Stash

In this blog, I will be explaining some JavaScript snippets which are very useful while developing extensions in Joomla. Let’s start one by one.

Continue reading
1
  5156 Hits
  0 Comments
5156 Hits
0 Comments

Difference between let and var keyword in JavaScript

Difference-between-Let-and-Var-in-JS

When any developer is working in JavaScript, He/She often uses let, var keywords. Most of us use it randomly as there has been a lot of confusion regarding the use of let and var in JavaScript. So, I am trying to clear most of the confusion by presenting one example.

So let’s check the difference between `let` and `var `with one example:

Continue reading
0
  10636 Hits
  0 Comments
10636 Hits
0 Comments

Using custom field of jform create textcounter

Using-custom-field-of-jform-create-textcounter-1
Joomla already has powerful form management libraries - jform, supported by jfield. There is plenty of built-in field types (text, textarea, integer, file, calendar and several more). However, once in a while you come across a special field that is not present. Or maybe extending the existing field types to add more features. These are perfect cand...
Continue reading
1
  2562 Hits
  0 Comments
2562 Hits
0 Comments

Using sub-forms to create repeatable fields

Using-sub-forms-to-create-repeatable-fields
Forms are everywhere on the web. From a simple sign up form to complicated application forms you’ve seen various forms with varying validation and fields. A very popular way to ask users to input multiple values for similar data is to use the “Add More” type field where the user can add any number of entries. Examples are Educational Qualification,...
Continue reading
11
  24074 Hits
  0 Comments
24074 Hits
0 Comments