Commit 612b62b3 authored by Telenkov Ruslan's avatar Telenkov Ruslan

this is rest api task

parent e3741c51
......@@ -40,6 +40,7 @@
"drupal/rabbit_hole": "^2.26",
"drupal/recaptcha": "^3.0",
"drupal/redirect": "^1.7",
"drupal/restui": "^1.20",
"drupal/search_api": "^1.23",
"drupal/search_api_autocomplete": "^1.6",
"drupal/shariff": "^1.5",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f3d718dfa53852c7031069d608f69011",
"content-hash": "1b24d35c84763c2fdcf7e4fca5e5d99e",
"packages": [
{
"name": "asm89/stack-cors",
......@@ -4222,6 +4222,62 @@
"source": "https://git.drupalcode.org/project/redirect"
}
},
{
"name": "drupal/restui",
"version": "1.20.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/restui.git",
"reference": "8.x-1.20"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/restui-8.x-1.20.zip",
"reference": "8.x-1.20",
"shasum": "df1d3c486ee0e7b4e9a24e6523a69c9efe73caff"
},
"require": {
"drupal/core": "^8.7.7 || ^9"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-1.20",
"datestamp": "1616839543",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "-enzo-",
"homepage": "https://www.drupal.org/user/294937"
},
{
"name": "clemens.tolboom",
"homepage": "https://www.drupal.org/user/125814"
},
{
"name": "juampynr",
"homepage": "https://www.drupal.org/user/682736"
},
{
"name": "klausi",
"homepage": "https://www.drupal.org/user/262198"
}
],
"description": "Provides a user interface to manage REST resources.",
"homepage": "https://www.drupal.org/project/restui",
"support": {
"source": "https://git.drupalcode.org/project/restui"
}
},
{
"name": "drupal/search_api",
"version": "1.23.0",
......
......@@ -214,8 +214,8 @@ class MyService
public function createPeopleNode($data, $node_id){
$node = Node::create(array(
'type' => 'people' ,
'title' => /*'people' . $counter[0][0]*/$data->name,
'field_swapi_id' => $node_id,
'title' => $data->name,
//'field_swapi_id' => $node_id,
'field_name' =>$data->name,
'field_height' =>$data->height,
'field_mass' =>$data->mass,
......
name: Test
description: Creates a page showing "Bootcamp".
name: TestRestApi
description: Rest Api module
package: Custom
type: module
core_version_requirement: ^8.8 || ^9
dependencies:
- rest
<?php
namespace Drupal\thanks\Controller;
class TestPage {
public function content(){
/**
* {@inheritdoc}
*/
return [
'#theme' => 'dummy_example_first',
];
}
}
name: TestB
name: Test Hook Theme
description: Creates a page showing "Bootcamp".
package: Custom
type: module
......
<?php
/**
* Implements hook_theme().
*/
function thanks_theme($existing, $type, $theme, $path) {
return [
'dummy_example_first' => [
'variables' => [],
],
];
}
/**
* Implements template_preprocess_HOOK().
* Обработчик переменных для первого примера.
*/
function template_preprocess_dummy_example_first(&$variables) {
$date_formatter = \Drupal::service('date.formatter');
$variables['date'] = $date_formatter->format(time());
}
thanks.test-page:
path: '/test-page'
defaults:
_controller: '\Drupal\thanks\Controller\TestPage::content'
_title: 'Test'
requirements:
_permission: 'access content'
......@@ -9,6 +9,6 @@ parameters:
debug: true
auto_reload: true
cache: false
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory
#services:
# cache.backend.null:
# class: Drupal\Core\Cache\NullBackendFactory
......@@ -123,8 +123,8 @@ switch ($current_env) {
$settings['trusted_host_patterns'] = [];
// Disable caching during development.
$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
$settings['cache']['bins']['page'] = 'cache.backend.null';
// $settings['cache']['bins']['render'] = 'cache.backend.null';
// $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
// $settings['cache']['bins']['page'] = 'cache.backend.null';
break;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment