You are here

function pdb_vue_component_info_alter in Decoupled Blocks: Vue.js 8

Add our component paths for Vue.

Parameters

object $components: List of individual block components.

File

./pdb_vue.module, line 16
Any procedural Vue PHP work lives here.

Code

function pdb_vue_component_info_alter($components) {

  // Read info files for each module.
  foreach ($components as $key => $component) {

    // Set component path if it hasn't been hardcoded.
    if ($component->info['presentation'] == 'vue' && empty($component->info['path'])) {
      $component->info['path'] = $component
        ->getPath();
    }
  }
}