How to install NodeJs, Gulp and Bower under *ubuntu (briefly)
How to install NodeJs, Gulp and Bower under *ubuntu (briefly)

This article is more of a necessity than a detailed guide on Node, Gulp, Bower, and NPM. The next few articles will touch on layout and front-end workflows, and lately, I’ve been increasingly using these tools to simplify and optimize the development process.

Brief overview:
Gulp — a project build tool written in Node.js
Bower — a package manager for web frontend, also built on Node.js
Node.js — a platform based on the V8 engine (which translates JavaScript into machine code)
NPM — the package manager for Node.js (Gulp and Bower are installed as its packages)

So, what do we ultimately need? — a working installation of Gulp and Bower. These will help us boost our productivity in web development.

To do this, we need to install Node.js and NPM. Let’s go.

Installation

Install NodeJs:

$ sudo apt-get install nodejs

Install the NPM package manager:

$ sudo apt-get install npm

Not sure how it works on Windows, but on Ubuntu it’s super easy 🙂 No need to download anything manually. Just enter the command, and voilà — it’s ready.

read more...

Caching in Yii2 and behaviors
Caching in Yii2 and behaviors

What should you do if you need to implement standard functionality (such as data caching) for some default models? In my case, behavior and its powerful capabilities came to the rescue.

In short, behavior in the Yii2 framework allows you to extend controllers and models (or anything inherited from the “Component” class) with additional methods. It works similarly to PHP traits but is not the same. If you’re interested in a more detailed explanation, check the official Yii documentation.

In this article, I’ll describe my experience combining caching, models, and behaviors.

Story: At a certain point in development, I needed to implement caching for four default models:

  • Rubrics
  • Categories
  • Regions
  • Cities

read more...

How to add your own button to TinyMCE editor
How to add your own button to TinyMCE editor

Let’s expand on this topic a bit by slightly improving the code for creating a custom button in the WordPress text editor. It’s not a major change, but this code turned out to be useful in one of my projects. I hope it will be helpful for you too, as there's not much information in Russian about the TinyMCE WYSIWYG editor — and it’s quite an interesting topic.

read more...

How to Add a Custom Button to the WordPress Editor
How to Add a Custom Button to the WordPress Editor

In this article, we'll look at a simple example of how to create a custom button for the WordPress text editor.

For those who don’t know, WordPress uses the TinyMCE web editor script. It’s a free script, and judging by the fact that it’s used in this CMS (it was also used in Joomla in the past — not sure about now), it clearly has some advantages over other editors.

read more...