How to clear the assets cache in Yii2

category:  Yii2.0 framework

With Yii2, it comes with the asset management calls asset bundle. An asset bundle is simply a collection of assets located in a directory. When you register an asset bundle in a view, it will include the CSS and JavaScript files in the bundle in the rendered Web page. Below is my asset bundle setting in my application. I use the advanced template from Yii2 and I use the frontend for my application(backend, console, and frontend folders are generated from the advanced … Read More

How to save the multi-records in one model in a single transaction in Yii2

category:  Yii2.0 framework

Recently I just add the new feature on my application. What new feature does, it generates the new invoice from the time-sheet. This way, my clients can see my log time and note on each task. So they know in detail what I did for their project. The steps are: get the time-sheet data filtered by the specific client, date range and unbilled status In the time-sheet loop, insert the new invoice and invoice detail If something goes wrong while … Read More

How to export database from Yii2 application

category:  Yii2.0 framework

The export database feature is nice to have for backup and restore the database from either website or web application. I added the export database in my application using the PHP based MySQL dump library. I did the search and found more two ways to achieve my goal but they have the issue with the null value and text data type. One of the two ways is to generate the insert script with PHP which can not generate the insert script … Read More

How to create the bulk action in Yii2

category:  Yii2.0 framework

Howdy, working in the back-end in the web application, often you will find the bulk actions is very useful when you want to do the action with more than one record at once. Today I will share with you how to create bulk actions and work with grid view widget. Plus I use the pjax widget to make the changes from the action without reloading the whole page. The screenshot below shows the bulk action in Yii2 Here is what … Read More

How to create the module in Yii2

category:  Yii2.0 framework

Recently I have been adding the new features to my own application. I add new features using the module so I can disable and enable each module easily in the application configuration. The module is a self-contained software unit that contains models, controllers and views and components. I prefer to use Gii module to create the new module. I set up my application with the advanced template and I build my application in the frontend root. Gii module URL(with enabling … Read More

How to remove the extension or package with composer

category:  Yii2.0 framework

Often when I work with the PHP framework and I want to install the extensions or packages in general term, in order to use in the framework, for PHP, we use composer. In js framework, you will use npm or yarn. To install the extensions, the third party(extension owner) page will let you know the installation composer command. But often they don’t provide you how to remove or uninstall the extensions. I will share this with you today. When the … Read More

(TM47) 90 days reporting for Thai Retirement Visa – Online

category:  Life in Chiang Mai

(last update on 9 Jan 2019) For Thai Retirement Visa, you must report every 90 days. It is time consuming if you have to report in person. Luckily, you have a choice that let you do online.   Follow the link below. You must use Internet Explorer to access this website. Chrome and Firefox do NOT work. 90 days reporting online   It will take around 24 hours for me and you should get the ACCEPTED email from the website. … Read More

How to add the pagination dropdown list in GridView in Yii2

category:  Yii2.0 framework

Earlier, I wrote how to add the summary footer in the gridview widget. The grand total column will sum all the total columns on each page and the default page size of gridview is 20 items per page. I want to be able to change the page size as I want in order to see the new grand total if I choose the search filter. Below is the screenshot that I did. We will add the extra code in two … Read More

How to add the summary in the Gridview footer in Yii2

category:  Yii2.0 framework

Currently, I am building the invoice feature in my own application with Yii2. I use the gridview widget for displaying all invoices data. I want to add the grand total for all invoices. Just like the screenshot below. To do that, I have to add the extra code in two places. Note that, I generate the CRUD from Gii. So I will show only the code that I add for displaying the grand total at the gridview footer. First place, … Read More

Building WordPress Plugins with Object-Oriented Concept

category:  WordPress

When I develop the custom plugin, I prefer to build the custom plugin with Object-Oriented Programming(OOP) to avoid the conflict from other plugins or the themes. Plus my code is cleaner and more organized. Today I will share how to create the report plugin with OOP. Here what the plugin does: The plugin will display the data regarding the criteria. I use the datatable plugin for the data table with search, pagination and column sort features. The datatable plugin has … Read More

1 6 7 8 9 10 11 12 13