Happy New Year and Merry Christmas!
- Dec 30, 2022
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 https://github.com/PHPOffice . This is a great library for working with office documents. With its help, you can read and form these documents in php.
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.
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: https://cms.skeeks.com/marketplace/components/tools/other/396-preobrazovanie-neaktivnyh-ssylok-v-tekste
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");
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.
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.
One option would be the following example:
In the config file of the project @ frontend / config / main.php add:
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).