Codxplore.com

Latest news:

Sahih al-Bukhari (সহীহ বুখারী) is a free Hadith application for android. This application is advertisement free. Download now https://play.google.com/store/apps/details?id=com.akramhossin.bukharisharif

467
Views
Install Node.js on Ubuntu 20.04

Install Node.js on Ubuntu 20.04

Initiation  Node.js is an open-source, cross-platform, back-end JavaScript runtime environment  that runs on the V8 engine and executes javaScript code outside a web browser Prerequisites for installing Node.js If you are using Ubuntu 20.04. Before we start, we should have an user account with sudo privileges set up on the system. We will learn how to do this by following these steps for Ub
2605
Views
Typeorm findAndCount relational table filter

Typeorm findAndCount relational table filter

To filter relational table in TypeORM using findAndCount there is a workaround. To filtering based on relation fields for findAndCount. We need to use ObjectLiteral-style where using this style conditions are works perfectly. Assume that we have Three entities – products,attributeSet and woodType. products belongs to one attributeSet and one woodType,  attributeSet and woodType has many prod
5882
Views
Generates models for TypeORM from existing databases

Generates models for TypeORM from existing databases

Typeorm is an ORM Which run in NodeJS, PhoneGap, Cordova, Ionic, Browser, NativeScript, Expo, React Native and Electron platforms.  We can use TypeORM with TypeScript and JavaScript (ES5, ES6, ES7, ES8). TypeORM is highly influenced by other ORMs such as Entity Framework, Hibernate, Doctrine. To generate model using TypeORM from existing database we need to install typeorm-model-generator. To
2764
Views
Pagination in react by react-paginate

Pagination in react by react-paginate

react-paginate is a ReactJS component to implement pagination to react js project. By installing this component and writing only a little bit of CSS code we can accomplish pagination. Installation: to Install react-paginate with npm please run the following command in terminal$ npm install react-paginate --save Usages: To use this feature we need to import it in top of our class as likeimport
2802
Views
Usages of PHP date, strtotime and mktime functions

Usages of PHP date, strtotime and mktime functions

To customize date and time PHP provides us some important functions such date, strtotime and mktime. In this post i will demonstrate some usages for these functions. Example 1: Get year start and end date for the current year we can use $yearStart = date("Y-m-d", strtotime('this year January 1st')); $yearEnd = date("Y-m-d", strtotime("this year December 31st")); Example 2: Get month start a
3436
Views
php export csv utf 8

php export csv utf 8

While generating a CSV using PHP sometimes we stumbled upon one common problem  where any special character like £ becomes ASCII in generated CSV file,  the reason behind this is the encoding of generated CSV is wrong and  we need to output CSV in UTF8 format, so we will be able to use special ASCII characters in CSV file. Using example below we can encode UTF8 generated CSV file,  We ne
2628
Views
Yii2 Scenarios validate only create Action

Yii2 Scenarios validate only create Action

Yii2 model scenarios can be used differently. Lets say, we have a model as Customer Which can be used to store customer sign-in inputs, but it can be also used for the customer sign-up purpose. In different scenarios, Yii2 model can be used in multiple business rules and logic.the email attribute may be required during customer sign-up, but not required customer sign-in. Yii2 model uses the y
2923
Views
 Yii2 - Get Current Action ID in main.php

Yii2 - Get Current Action ID in main.php

Yii2 web application project, sometimes we need to current controller ID, action ID. Specially when we need role based access control, we need to check the controller ID as well as action ID. Using Yii2 view context api we can get these data. for example if we need controller ID we can use below code $controller = $this->context->action->controller->id; if we need action ID only we can use as
1916
Views
jQuery text(), html(), and val() Usages

jQuery text(), html(), and val() Usages

In this blog post i will try to explain jQuery text(), html(), and val()  methods, there defination and uses. jQuery text(): From the matched element jQuery text() method get the text contents of the particular element or Sets or returns the text content of selected elements The following example demonstrates how to set content with the jQuery text() $("#btn1").click(function(){    $("#test
3103
Views
Yii2 pagination

Yii2 pagination

Today we will discuss how to implement pagination to any Yii2 web application. The pagination represents information relevant to pagination of data items fetch from any data sources. When we need data to be rendered in multiple pages,this can be used to display information such as total item count, page size, current page. Pagination implementation has two steps. Fetch data from data source
1764
Views
 How to create virtual column using MySQL SELECT?

How to create virtual column using MySQL SELECT?

Virtual column in MySQL is generated column, this column data or value comes from expression or function or other columns. The difference between virtual column and normal column is normal table column value saved to disk but virtual column value generated dynamically from any expression or function or from other columns. So the virtual column has following characteristics Virtual column is
2352
Views
Yii2 joinWith(), innerJoinWith(), join(), leftJoin()

Yii2 joinWith(), innerJoinWith(), join(), leftJoin()

Yii2 active record has powerful built-in feature to join database table. In this post we will learn some of the useful features joinWith() innerJoinWith(), join() leftJoin() join using query builder Example of joinWith(): $model = Users::find()                ->joinWith('posts', false, 'INNER JOIN')                ->all(); Example of innerJoinWith(): $mod

Subscribe Us


Follow Us