i tried to add some code to my theme, following this: How do I include JavaScript on a single page in a way that is amenable to scale
i created my js file in: C:\xampp\htdocs\drupal-8.7.2\themes\bootstrap\js
i put this on the file: (function ($ ) { Drupal.behaviors.[myName] = { attach: function(context, settings) {
//Begin my code alert("'.$ phpvariable.'"); //I'm done with my code } }; })(jQuery);
so i opened the file bootstrap.libraries.yml and putted this:
my-library: js: js/my-script.js: {}
after that i put on the file bootstrap.info.yml this:
type: theme base theme: false
name: ‘Bootstrap’ description: ‘Built to use Bootstrap, a sleek, intuitive, and powerful front-end framework for faster and easier web development.’ package: ‘Bootstrap’
core: 8.x libraries: – my-theme/global-effects – bootstrap/js/my-library
now…nothing work and i not understand why….can anyone help me?