How to Check Twig Version in Symfony
Finding out which version of the Twig you have installed in Symfony framework can be useful when solving bugs or installing packages. This tutorial shows how to check Twig version in Symfony. We can use the Environment::VERSION constant to determine Twig version. test.php This constant can be used in the template as follows: templates/test/index.html.twig
How to check the PHP version
Newer PHP versions come with more features and improvements while deprecating some obsolete features. Old PHP codes might not work with more recent PHP versions and vice versa. It is, therefore, essential to use the correct PHP version for your code. You can check the PHP version on your system by running the php command from the command line. There are also some PHP functions that you can use…
ReactJs Properties
A component props is an object that holds information about that component. They are similar to attributes in HTML. In fact, they are passed to the components the same way attributes are passed to HTML. Here’s the code for the component we made in my previous article. Adding Properties to Components So let’s say we want to…
Difference Between Git and GitHub
Git and GitHub are the same and serve the same purpose, but this is not the case. Git is a version control system used to manage different versions of our project whereas GitHub is a Git repository hosting service. Git- Git is a very popular version control system used to manage projects. However, a version…
How to make the scrollbar visible in mobile browsers with CSS?
Sometimes, we want to make the scrollbar visible in mobile browsers with CSS. In this article, we’ll look at how to make the scrollbar visible in mobile browsers with CSS. To make the scrollbar visible in mobile browsers with CSS, we set the scrollbar’s width. For instance, we write to set the vertical width of…
Read More “How to make the scrollbar visible in mobile browsers with CSS?” »
How to Use useLocation Hook in React Router DOM V6
You are already familiar with the basics of React. Also, having a good understanding of React Router DOM. This post will be totally dependent on these. If you don’t have a React app setup, then you can create it. Else, you can move ahead with the existing React App. Create React App You can create a…
Read More “How to Use useLocation Hook in React Router DOM V6” »
How to change password in the CodeIgniter framework
How to send forgot password in CodeIgniter framework PHP. Here we using 2 files to insert data in MySQL: Forms.php Path: codeIgniter\application\controllers\Forms.php forgot_pass.php Path: codeIgniter\application\views\change_pass.php Forms.php (Controller) <?php class Forms extends CI_Controller { public function __construct() { parent::__construct(); $this->load->database(); $this->load->library(‘session’); $this->load->helper(‘url’); $this->load->model(‘Hello_model’); } public function forgot_pass() { if($this->input->post(‘forgot_pass’)) { $email=$this->input->post(’email’); $que=$this->db->query(“select pass,email from user_login where email=’$email'”); $row=$que->row();…
Read More “How to change password in the CodeIgniter framework” »
How to increase browser zoom level on page load with CSS?
Sometimes, we want to increase the browser zoom level on page load with CSS. In this article, we’ll look at how to increase browser zoom level on page load with CSS. To increase browser zoom level on page load with CSS, we set the zoom property. For instance, we write to set zoom to 2 on the zoom class. Then the…
Read More “How to increase browser zoom level on page load with CSS?” »
How to trigger a button click from another button click event with JavaScript?
Sometimes, we want to trigger a button click from another button click event with JavaScript. In this article, we’ll look at how to trigger a button click from another button click event with JavaScript. To trigger a button click from another button click event with JavaScript, we call the element click method. For instance, we write to…
Read More “How to trigger a button click from another button click event with JavaScript?” »
PHP 8: Attributes
As of PHP 8, we’ll be able to use attributes. The goal of these attributes, also known as annotations in many other languages, is to add metadata to classes, methods, variables, and whatnot; in a structured way. The concept of attributes isn’t new at all, we’ve been using docblocks to simulate their behavior for years…
How to Object Destructuring in ES6
This is a follow-up article to my previous article on Array Destructuring. Except you have an idea of destructuring, you should read it. First, let’s see why object destructuring is needed. We want to extract data from the object and assign it to new variables. Before ES6, how would this happen? See how tedious it is…
How do sum values from an array of key-value pairs in JavaScript?
To fix getFullyear() is not a function with JavaScript, we should be called getFullYear instead. For instance, we write to call start.getFullYear to return the 4-digit year number of the start date. Conclusion To fix getFullyear() is not a function with JavaScript, we should be called getFullYear instead.
How to create the first Git Repository
Welcome to the tutorial on Git. Here you will learn how to Create a Repository, and how to clone or copy other repositories. A Repository is a project that is tracked and managed by Git. Thus, Git tracks changes by storing snapshots of project versions in a .git file. Git Config There is a need…
Understanding State in React Components
A difference between state and props is that while the data stored by props are fixed throughout their lifetime, state store data that can be changed over time. This change can be in response to user actions, network responses, or anything. Also, while props are set by the parent component, state is changed internally by the component itself. A component’s state should be considered private data. This…
How to Delete and Remove Files on Ubuntu Linux Terminal
Delete and remove files on ubuntu Linux using the terminal. In this tutorial, you will learn how to delete and remove a file on Ubuntu Linux-based system using a terminal or command prompt. This tutorial will use the rm command. It tries to remove the files specified on the command line. Use the rm command…
Read More “How to Delete and Remove Files on Ubuntu Linux Terminal” »
How to Recover Deleted WhatsApp Messages
Recover Deleted Messages From Google Drive & iCloud For Android For Android users, one of the best ways to restore your deleted WhatsApp messages is to restore your backup from Google Drive. But It is only possible if you have set your backup option ON in App. If you have not set a backup option…
How to Send Email from Localhost in PHP
PHP sends email using the Inbuilt PHP MAIL() function. This tutorial shows you how you can send emails in PHP using the inbuilt PHP mail() function. If you work with PHP, you need to send emails to users like when the user registered with us, send a reset password link in the mail, if any…
How to fix getFullyear() is not a function with JavaScript?
Sometimes, we want to fix getFullyear() is not a function with JavaScript. In this article, we’ll look at how to fix getFullyear() is not a function with JavaScript. To fix getFullyear() is not a function with JavaScript, we should be called getFullYear instead. For instance, we write to call start.getFullYear to return the 4-digit year number of the start date. Conclusion…
Read More “How to fix getFullyear() is not a function with JavaScript?” »
How to use events listeners and Event Subscriber in Symfony
We use events to perform some tasks if an event occurs, these tasks can be achieved by using the followings: 1. Event Subscriber 2. Event Listeners Event Subscriber vs Event Listeners They both serve the same purpose but have different implementations. Both trigger some functions in the specific time of processing data by Symfony. We can declare…
Read More “How to use events listeners and Event Subscriber in Symfony” »
How to split a string into an array with Twig
Twig provides many filters that mimic the basic features of PHP that are easy to understand for front-end developers. One of those filters is a split filter that allows you to split a delimited string by a single character, returning a repeating array. You can limit the length of the result array providing it as…