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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/monokai.min.css"> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script> | |
| </head> | |
| <body> | |
| <pre> |
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 | |
| /** | |
| * | |
| */ | |
| function imageCreateFromUrl($url) { | |
| // Ex Remote image URL. | |
| $url = 'https://www.mon-site.com/sites/default/files/logo_upload/logo.png'; | |
| // Image path. | |
| $remote_image_directory = 'https://www.mon-site.com/sites/default/files/logo_upload/'; |
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 | |
| $input = '/carousel-'; | |
| $node_query_result = []; | |
| $path_query = \Drupal::database()->select('path_alias', 'a'); | |
| $path_query->addField('a', 'path'); | |
| $path_query->condition('a.alias', '%' . $input . '%', 'LIKE'); | |
| $path_query_result = str_replace('/node/', '', $path_query->execute()->fetchCol()); | |
| if ($path_query_result) { | |
| $node_query = \Drupal::database()->select('node_field_data', 'n'); | |
| $node_query->addField('n', 'nid'); |
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 | |
| public function buildForm(array $form, FormStateInterface $form_state) { | |
| $form['valider'] = [ | |
| '#type' => 'checkbox', | |
| '#title' => 'valider', | |
| ]; | |
| $form['Text'] = [ | |
| '#type' => 'textfield', | |
| '#default_value' => 'Rechercher', | |
| '#states' => [ |
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 | |
| public function buildForm(array $form, FormStateInterface $form_state) { | |
| $form['valider'] = [ | |
| '#type' => 'checkbox', | |
| '#title' => 'valider', | |
| ]; | |
| $form['Text'] = [ | |
| '#type' => 'textfield', | |
| '#default_value' => 'Rechercher', | |
| '#states' => [ |
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 | |
| $to = "ralava@andrana.nn"; | |
| $subject = "Télétravail"; | |
| $message='Bonjour,<br>Je suis en télétravail aujourd\'hui le '.date("d/m/Y").'<br><br>Très Sincèrement,<br><br>Jean Nica'; | |
| $headers = [ | |
| 'MIME-Version: 1.0', | |
| 'Content-Type: text/html; charset=UTF-8', | |
| 'From: moiralava@andrana.nn', | |
| 'Cc: izy@andrana.nn, izy2@andrana.nn', | |
| ]; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Geocoding Service</title> | |
| <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
| <meta charset="utf-8"> | |
| <style> | |
| /* Always set the map height explicitly to define the size of the div | |
| * element that contains the map. */ | |
| #map { |
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
| @-webkit-keyframes autofill { | |
| to { | |
| color: #000; | |
| background: transparent; | |
| } | |
| } | |
| input:-webkit-autofill { | |
| -webkit-animation-name: autofill; | |
| -webkit-animation-fill-mode: both; | |
| } |
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 | |
| public static function dateToFrench($date, $format) | |
| { | |
| $english_days = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'); | |
| $french_days = array('Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'); | |
| $english_months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); | |
| $french_months = array('Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'); | |
| return str_replace($english_months, $french_months, str_replace($english_days, $french_days, date($format, strtotime($date) ) ) ); | |
| } |
NewerOlder