Skip to content

Instantly share code, notes, and snippets.

View radheymkumar's full-sized avatar

Radheshyam Kumawat radheymkumar

  • PTI WebTech
  • Jaipur
View GitHub Profile
LANG_TRANSLATE = https://drupal.stackexchange.com/questions/249408/how-to-create-a-list-of-untranslated-content-in-views/249411#249411
/* Get Path */
$path = \Drupal::request()->getpathInfo();
$arg = explode('/',$path);
/*Get User info */
$current_user = \Drupal::currentUser();
/* http://drupal8.support/en/ontdek */
<?php
$server = "localhost";
$username = "xxxx";
$pasword = "xxxx";
$dbName = "xxxx";
$conn = new mysqli($server, $username, $pasword, $dbName);
if($conn->connect_error) {
die('Connection Error'. $conn->connect_error);
}
@radheymkumar
radheymkumar / gist:c7043dc9e993bf55ed9261431f348a00
Created April 12, 2018 12:47
get even and odd value in array
print_r(array_filter($numbers, 'isPositive'));
function isPositive($val) {
//return ($val > 50) ? true : false;
if($val%2 == 1) {
return $val;
}
}
function education_start_end_validates(array &$form, FormStateInterface $form_state) {
foreach ($form_state->getValue('edu_education_field') as $key => $value) {
if($value['start_date'] > $value['end_expected_end_date']) {
$form_state->setErrorByName("end_expected_end_date", t('Education : End/Expected End Date should be the greater than Start Date.'));
}
}
}
<a class="use-ajax" data-dialog-type="modal" data-dialog-options='{"height":"475","width":"640"}'
href="{{ path }}"> {{ field_video_thumbnail_image }} </a>
http://www.phpfreaks.com/tutorial/oo-php-part-1-oop-in-full-effect
https://www.drupal.org/node/116539
http://makitweb.com/category/jquery/
geeksforgeeks.org
http://www.ryanwright.me/cookbook/drupal7/table/table-drag/simple
Example:
use Drupal\Component\Render\FormattableMarkup;
$text = new FormattableMarkup('My name is @name', ['@name' => "The name"]);
Theme table row to link particular column data.
Example:
use Drupal\Component\Render\FormattableMarkup;
$rows[] = [
'data' => [
'name' => new FormattableMarkup('<a href=":link">@name</a>', [':link' => $url, '@name' => $name]),
<!DOCTYPE html>
<html>
<head>
<title>Jquery Str</title>
<meta charset="utf-8"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
/* accordion */
$('.accordion-header').click(function(){
How To Set Up Apache Virtual Hosts on Ubuntu : -
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
Step One — Create the Directory Structure
sudo mkdir -p /var/www/dev.drupal.com
sudo mkdir -p /var/www/dev.rwjf2.com
Step Two — Grant Permissions
sudo chmod -R 755 /var/www
1. Solr Server setup
-----------------------------------------------------------------------------
Use below link as a reference
https://www.webfoobar.com/node/16
https://valuebound.com/resources/blog/installing-configuring-apache-solr-520-with-drupal-7-using-search-api-ubuntu-1404
1. If Java is not installed, check the available versions of Java and install it:
yum list available java*
yum install java-1.8.0-openjdk.x86_64
-----------------------------------------------