Developers / programmers

Some useful tricks and snippets for working with phpoffice.

In the course of work, one often has to deal with tasks that are solved by reading the documentation of some kind of library.

So in particular, this time I had to run into . This is a great library for working with office documents. With its help, you can read and form these documents in php.


How to generate yii2 migrations from a database?

We are talking about the fact that we have already done the project and have a database, but there are no migrations designed according to the rules of yii2.


How to convert inactive links in the text to active (clickable)?

A very frequent task in order to provide your users with high-quality and convenient site functionality is the conversion of links in plain text or html. After all, when you give your users something to write independently on the site (for example, comments), then of course you try to protect them from html code. But if they do not use it, then they cannot select links according to the html rules. And it needs to be done for them.

For projects on the yii2 framework, I wrote a small extension:


How to copy javascript text to clipboard?

To copy any text into js clipboard, you can paste this text into input, which must be visible and not in a twisted div, select it and use the built-in js document.exe function ("copy");


How to correctly change the hostname in Proxmox 7?

There are situations when you need to change the hostname of the server.

For example, if you installed Proxmox7 on the server and subsequently changed the hostname and the web interface of the Proxmox panel stopped working.


Translation coordinates nmea in degrees for use in Yandex and Google maps. Php gist.

During the implementation of one interesting project (related to GPS navigation), the data comes to the server from GPS in the nmea format. And the coordinates, in turn, for use in the web need additional processing.

I leave a small gist coordinate transformation in the php language.


How to override jQuery in yii2 project?

One option would be the following example:

In the config file of the project @ frontend / config / main.php add:


How to connect a separate template for a mobile device in a Yii2 project.

During the work on any project (using the Yii2 php framework), very often there is a need to connect a separate template for different devices (tablet, phone, PC).