This file contains 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 | |
// Programmatically create files. | |
use Drupal\file\Entity\File; | |
$file = File::create([ | |
'uid' => 1, | |
'filename' => 'logo.svg', | |
'uri' => 'public://page/logo.svg', | |
'status' => 1, | |
]); |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>jQuery UI Datepicker - Display month & year menus</title> | |
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> | |
<link rel="stylesheet" href="bootstrap-datepicker.css"> | |
<script src="https://code.jquery.com/jquery-1.12.4.js"></script> | |
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> |
This file contains 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
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Url; | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
use Drupal\Core\Messenger\MessengerInterface; | |
/** | |
* Implements hook_form_FORM_ID_alter(). | |
*/ | |
function MODULE_NAME_form_alter( array &$form, FormStateInterface $form_state, $form_id ) { |
This file contains 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
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Ajax\AjaxResponse; | |
use Drupal\Core\Ajax\OpenModalDialogCommand; | |
use Drupal\Core\Ajax\CloseModalDialogCommand; | |
use Drupal\Core\Ajex\RedirectCommand; | |
use Drupal\Core\Ajex\HtmlCommand; | |
use Drupal\Core\Url; | |
use Drupal\Core\Ajex\ReplaceCommand; | |
This file contains 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
//Jquery Remove disabled attribut from submit form. validate form without jquery validation. | |
<form> | |
<input type="text" class="form_field"> | |
<input type="text" class="form_field"> | |
<input type="email" class="form_field"> | |
<input type="submit" class="sendButton"> | |
</form> | |
<script> | |
$('.sendButton').prop('disabled', true); |
This file contains 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
/* | |
* Impliment user insert give default role. | |
*/ | |
function hook_user_insert(Drupal\Core\Entity\EntityInterface $entity) { | |
$entity->addRole('role_name'); | |
$entity->save(); | |
} |
This file contains 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
composer update drupal/core --with-dependencies | |
composer require drush/drush | |
composer require drupal/admin_toolbar | |
drush en admin_toolbar admin_toolbar_tools admin_toolbar_links_access_filter |
This file contains 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
How to work c program in terminal command in ubuntu | |
once you checked GCC version | |
command = gcc --version | |
install c compiler | |
command = sudo apt install build-essential |
This file contains 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
CREATE TABLE `watchdog` ( | |
`wid` int(11) NOT NULL auto_increment, | |
`uid` int(11) NOT NULL default '0', | |
`type` varchar(16) NOT NULL default '', | |
`message` longtext NOT NULL, | |
`variables` longtext NOT NULL, | |
`severity` tinyint(3) unsigned NOT NULL default '0', | |
`link` varchar(255) NOT NULL default '', | |
`location` text NOT NULL, | |
`referer` varchar(128) NOT NULL default '', |
OlderNewer