Search code examples
phpsymfonyassetssymlink

Is there a way to change name of generated by assets:install symbolic link in symfony?


I see by default there are generated links with name bundle/bundlename when using assets:install command. Is there a way to change this name?


Solution

  • You can inspect the current code that is used in Symfony's repository. To define the folder per bundle, a single line is used:

    $assetDir = preg_replace('/bundle$/', '', strtolower($bundle->getName()));
    

    There are no parts to hook into this generation from the outside, neither defined in the command itself (such that you could decorate the command) nor in the bundle's definition (such that you would gain more freedom to generate a folder name within the bundle, that is not bound to the getName method).