Send values from js to php

Hi everyone

In my module i have a js code with some variebles.

 

I want to send the values of variebles in php code (FirstController.php)

I know that js is in client side and php in server but i want a simple way to get values from js to php

js code

var response = something.innertext;

php code

public function example() {

$example = """the value of respone"""

echo $example;

.........

Ajax response not fully rendered

Hello,

I try to handle a list of items on a node advanced form using ajax. Each list item has a textfield and a remove button. There is an add button under the list to add items. Add button and delete buttons use ajax. Items added on page load are ok, but the ones added through ajax are not complete. Textfields do not have default value or description. Moreover, the delete buttons do not seem to work. My code:

Custom menu link is not enabling or disabling from admin UI in Drupal 8.x

Hi,

I have created a custom menu link using links.menu.yml file in drupal 8.x and also add a class file to manage it's access for user roles based.

But now I want to disable this link so i am using Admin UI (i.e drupal/admin/structure/menu).

But unfortunately unable to disable it.

Here also i am sharing my code

My menu link code below here :

my_module.admin:
title: 'My Menu'
menu_name: 'main'
expanded: TRUE
url: 'internal:'
class: Drupal\my_module\Plugin\Menu\Access(file name)

Any suggestion ??

Covenant House

Covenant House site on multiple devices

Supporting a strong web presence to empower homeless youth.

Covenant House International has helped millions of homeless, runaway, and trafficked youth for more than 40 years. Driven by a mission to treat young people with respect and unconditional love, their online presence is an integral part of the fundraising that enables them to do more good.

Sectors: 
Non-profit

D8 EntityQuery random sort

Hi guys,

how to add a random sort to entityquery??

I knew the way of addtag for d7 but how to gonna get work on d8?

Any suggestion?
thank you!!

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x