// Ascending order
Partner::model()->findAll(array('order' => 'company'));
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Bootstrap 3 - Carousel/Slider Collection | |
| Article: http://sevenx.de/blog | |
| Demo: http://sevenx.de/demo/bootstrap-carousel | |
| Working Examples (inline Styles, CDN Scripts) | |
| - minimal Bootstrap Markup changes | |
| - minimal CSS Styles | |
| - minimal jQuery |
Docker compose is a tool that is used for defining and running multi-container Docker apps in an easy way.
It provides docker-compose.yml configuration file that can be used to bring up an app and the suite of services it depends on
with just one command.
docker-compose up- start all services fromdocker-compose.ymldocker-compose up db- start only servicedbdocker-compose up --build- rebuild all images and run containersdocker-compose -f docker-compose.prod.yml up- start all services fromdocker-compose.prod.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frontend | |
| server { | |
| listen 80; | |
| server_name yii2.lo; | |
| server_tokens off; | |
| client_max_body_size 128M; | |
| charset utf-8; | |
| access_log /var/log/nginx/yii2-access.log main buffer=50k; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Преобразует SimpleXMLElement в array | |
| * @param SimpleXMLElement $xml | |
| * @return array | |
| */ | |
| private static function xmlToArray($xml) { | |
| $xml = (array) $xml; | |
| if(empty($xml)) { | |
| return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $dataArr = [ | |
| 0 => 'EF001391', | |
| 1 => 'EF000228', | |
| 2 => 'EF000227', | |
| ]; | |
| $debug_log = Yii::app()->runtimePath . '/DebugExport.log'; | |
| $dataErr = print_r($dataArr, true); | |
| file_put_contents($debug_log, $dataErr . PHP_EOL, FILE_APPEND); | |
| ================================ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Как удалить любую папку, в т.ч. и .idea, и лишние файлы из Git | |
| Создаем файл .gitignore в корне репозитария с содержимым: | |
| .idea | |
| logs/ | |
| ------------------------------------------------------------------ | |
| Подробнее можно ознакомиться на странице: https://git-scm.com/book/ru/v1/Основы-Git-Запись-изменений-в-репозиторий | |
| Удаляем ненужные папки и файлы при синхронизации в Git репозиторий |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected function getFilename(UploadedFile $file): string | |
| { | |
| $hash = sha1_file($file->tempName); | |
| $name = substr_replace($hash, '/', 3, 0); | |
| $name = substr_replace($name, '/', 7, 0); | |
| return $name . DIRECTORY_SEPARATOR . $file->extension; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $tmpFile = $sourceFileName; | |
| $fileName = $this->csvFilePath . DIRECTORY_SEPARATOR . $this->csvFileName; | |
| $command = 'xls2csv -c\; -q0 -s cp1251 -d cp1251 ' . $tmpFile . ' > ' . $fileName; | |
| exec($command); | |
| unlink($tmpFile); |