Welcome Guest, Not a member yet? Register   Sign In
How to include script located in node_modules folder using codeigniter 4?
#1

I need to install this plugin on my application, so I followed the instruction and executed:

    
PHP Code:
npm install --save @ckeditor/ckeditor5-upload 


Usually, to load a plugin I create a file inside the `load` directory which contains the plugin name, in particular:

   
PHP Code:
Views
        load
            ckeditor
.php 

which contains this:

   
PHP Code:
<!-- Push section js -->
    <?= $this->section('js'?>
    <script src="https://cdn.ckeditor.com/ckeditor5/27.1.0/classic/ckeditor.js"></script>
    <script src="https://cdn.ckeditor.com/ckeditor5/27.1.0/classic/translations/it.js"></script>
    <?= $this->endSection() ?>

so to include in a specific section of my app, I simply do:

   
PHP Code:
<?= $this->include('App\Views\Backend\load\ckeditor'?>


and this will inject the plugin into my app, but how can I do this with local dependencies installed via npm?
Reply


Messages In This Thread
How to include script located in node_modules folder using codeigniter 4? - by sfarzoso - 05-20-2021, 01:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB