id
name
surname
sex
email
password
is_confirmed
role(guest/user/farmer/admin)
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
| <?php | |
| declare(strict_types=1); | |
| if (!function_exists('humanCountNumber')) { | |
| /** | |
| * Generate the URL to a controller action. | |
| * @param int $count | |
| * @param string $delimiter | |
| * @return string |
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
| <?php | |
| namespace App; | |
| use DB; | |
| use Illuminate\Database\Eloquent\Model; | |
| class BlogCategory extends Model | |
| { | |
| protected $table = 'blog_categories'; | |
| protected $primaryKey = 'id'; |
Эликсир очень похож на Руби на поверхности, но есть некоторые большие различия. Это может быть борьба, чтобы знать, как стиль кода. К счастью, niftynate собрал руководство по стилю. Я нашел его очень полезным и воспроизвел его здесь в немного более дружественном формате. Все оригинальные работы можно найти в их репозитории.
sfsdf sf
sdfsdfsdf лолоаловалва
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
| # Type definition of a User | |
| type User { | |
| id: ID! | |
| name: String! | |
| } |
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
| <style>.current_page{color: red;}</style> | |
| <? | |
| function pagination($posts,$on_page='10',$mini_view=7,$delim=' ... ',$this_page='class="current_page"') { | |
| # ПОСТРАНИЧНАЯ НАВИГАЦИЯ | |
| /** | |
| * $posts - всего элементов | |
| * $on_page - элементов на одной странице | |
| * $mini_view - сколько отображать страниц в навигации минимально 5, непарное число! | |
| * $delim - разделитель | |
| * $this_page - можно прописать css класс для выделения текущей страницы |
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
| <? | |
| //запуск секундомера | |
| $start = microtime(true); | |
| # масив ссылок | |
| $urls = array( | |
| 'http://liveandlearn.com.ua/dayte-meni-tisyachu-rokiv-i-ya-rozmalyuyu-nebo/', | |
| 'http://liveandlearn.com.ua/vse-v-nashih-rukah/', | |
| 'http://liveandlearn.com.ua/slipiy-ta-lihtar/' | |
| ); |
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
| <? | |
| function translit($str) { | |
| $rus = array(',','?','!','–',' ','А', 'Б', 'В', 'Г', 'Д', 'Е','Є', 'Ё', 'Ж', 'З', 'И','І','Ї', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я', | |
| 'а', 'б', 'в', 'г', 'д', 'е', 'є', 'ё', 'ж', 'з', 'и','і','ї', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я'); | |
| $lat = array('','','','-','-','A', 'B', 'V', 'G', 'D', 'E', 'E', 'E', 'Gh', 'Z', 'I','I','Yi', 'Y', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'H', 'Ts', 'Ch', 'Sh', 'Sch', 'Y', 'Y', 'Y', 'E', 'Yu', 'Ya', | |
| 'a', 'b', 'v', 'g', 'd', 'e', 'e', 'e', 'gh', 'z', 'i','i','yi', 'y', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'h', 'ts', 'ch', 'sh', 'sch', 'y', 'y', 'y', 'e', 'yu', 'ya'); | |
| //return str_replace($rus, $lat, $str); | |
| $new=str_replace($rus, $lat, $str); | |
| $what = array('---','--','.-'); | |
| $be=array('-','-','-'); |
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
| <? | |
| trim(htmlspecialchars($_GET[post])); | |
| //для страниц $_GET[page] | |
| //защита от отрицательных, нулевых, спец знаков | |
| if (empty($_GET[page])) { | |
| $vid=0; | |
| }else{ | |
| //10 количество выводимих элементов на странице | |
| $vid=(abs((int) $_GET['page'])-1)*10; |
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
| $start = microtime(true); | |
| # ... | |
| $time = microtime(true) - $start; | |
| printf('Скрипт выполнялся %.4F сек.', $time); |
NewerOlder