🧙♂️
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
| $array1 = array("PHP" => "Rasmus", "Javascript" => "Brendan", "R" => "Robert", "flextype" => ["founder" => "Sergey"], 10 => 'num1', '11' => 'num1'); | |
| $array2 = array("Java" => "James", "R" => "Ross", "Python" => "Guido", "flextype" => ['version' => '1.0'], 10 => 'num2', '11' => 'num2'); | |
| $result = array_merge($array1, $array2); | |
| $result2 = array_replace($array1, $array2); | |
| $result3 = array_merge_recursive($array1, $array2); | |
| $result4 = array_replace_recursive($array1, $array2); | |
| echo '<pre>array_merge: <br>'; | |
| print_r($result); |
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
| ### Keybase proof | |
| I hereby claim: | |
| * I am Awilum on github. | |
| * I am awilum (https://keybase.io/awilum) on keybase. | |
| * I have a public key whose fingerprint is 6348 9E76 D86B 773D 0B30 024A 923A FFE7 3AC6 DB03 | |
| To claim this, I am signing this object: |
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 checkboxField(string $element, string $name, $value, array $property) : string | |
| { | |
| $field = '<div class="form-group ' . $property['size'] . '">'; | |
| $field .= '<div class="custom-control custom-checkbox">'; | |
| $field .= '<input type="checkbox" value="'. ($value == 'checked' ? 'checked' : '') .'" name="'. $name .'" class="custom-control-input" id="'. $element .'" '. ($value == 'checked' ? 'checked="checked"' : '') .'>'; | |
| $field .= ($property['title'] ? '<label class="custom-control-label" for="'. $element .'">'. __($property['title']) .'</label>' : ''); | |
| $field .= '</div>'; | |
| $field .= '</div>'; | |
| return $field; |
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
| for ($i=0; $i < 10000; $i++) { | |
| mkdir(__DIR__ . '/site/entries/blog/' . 'post' . $i); | |
| file_put_contents(__DIR__ . '/site/entries/blog/' . 'post' . $i . '/entry.md'," | |
| --- | |
| title: 'Allamco laboris nisi ut aliquip nisi ut aliquip {$i}' | |
| summary: '<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>' | |
| template: blog-post | |
| fieldset: blog-post | |
| description: '' | |
| uuid: 81ce89fa-7a95-4a01-b37f-b7f9b7dc2c9a |
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 Flextype; | |
| use Flextype\Component\Event\Event; | |
| use Flextype\Component\Filesystem\Filesystem; | |
| use Thunder\Shortcode\Shortcode\ShortcodeInterface; | |
| // Event: onShortcodesInitialized | |
| Event::addListener('onShortcodesInitialized', function () { |
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 | |
| /** | |
| * @package Flextype Components | |
| * | |
| * @author Sergey Romanenko <awilum@yandex.ru> | |
| * @link http://components.flextype.org | |
| * | |
| * For the full copyright and license information, please view the LICENSE | |
| * file that was distributed with this source code. |
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 | |
| /** | |
| * @package Flextype | |
| * | |
| * @author Sergey Romanenko <awilum@yandex.ru> | |
| * @link http://flextype.org | |
| * | |
| * For the full copyright and license information, please view the LICENSE | |
| * file that was distributed with this source code. |
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
| $multi_language_entries = true; | |
| // Set current requested entry data to global $entry array | |
| if ($multi_language_entries) { | |
| $locales = ['ru', 'en']; | |
| $default_locale = 'en'; | |
| if (in_array(Http::getUriSegment(0), $locales)) { | |
| if (Http::getUriSegment(0) == $default_locale) { |
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
| // Simple text-input, for multi-line fields. | |
| textarea | |
| // The hidden field is like the text field, except it's hidden from the content editor. | |
| hidden | |
| // A WYSIWYG HTML field. | |
| html | |
| // A specific WYSIWYG HTML field for entry content editing |