Sublime Text 3 Package for easy overriding files from Symfony2 bundles.
It greatly simplifies the work with bundles, that have files with a high level of nesting.
At this time, package can override php files, twig templates, translations in any format and any file from Resources/public folder.
For example, it can:
- Copy Twig templates from
vendor/Vendor/BundleName/Resources/views/High/Nesting/Level/template.html.twigtoapp/Resources/VendorBundleName/views/High/Nesting/Level/template.html.twigorsrc/SelectedBundleName/Resources/views/High/Nesting/Level/template.html.twig. - Copy
.xliff,.yml,.phpor whatever files fromvendor/Vendor/BundleName/Resources/translations/whatever.ymltosrc/SelectedBundleName/Resources/translations/whatever.ymlorapp/Resources/VendorBundleName/translations/whatever.yml. - Copy
.phpfiles fromvendor/Vendor/BundleName/High/Nesting/Level/Whatever.phptosrc/SelectedBundleName/High/Nesting/Level/Whatever.php.- Replace old namespace to new one
- Paste
use Vendor\BundleName\High\Nesting\Level\Whatever as BaseWhateverstatement with source class namespace - Replace
class Whateverorclass Whatever extends SomeBaseClasstoclass Whatever extends BaseWhatever
- Copy files from
publicfolder to selected bundle (css, js, etc)
After file have been copied, it automatically opens in editor.
- Package work only in Sublime Text 3. Not tested in Sublime Text 2.
- Package tested only on Ubuntu and MacOS environment.
- At that moment package supports overriding only PSR-0 libraries from
vendorsdirectory
Functions that will be implemented in future collected in TODO.md.
cd ~/.config/sublime-text-3/Packages
git clone https://github.com/igormukhingmailcom/sublimetext3-symfony2-override-package.git "Symfony2 Override"cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages
git clone https://github.com/igormukhingmailcom/sublimetext3-symfony2-override-package.git "Symfony2 Override"Install Package Control in your Sublime Text.
Press Ctrl+Shift+P, type Install Package, press Enter, type Symfony2 Override, press Enter.
Press Ctrl+Shift+O on Linux
or Command+Shift+O on MacOs
and select a bundle to copy current file to.
Also Override... menu item available at Context Menu, Side Bar Menu and Main Menu -> File.
If file already overriden, it will be just opened.
MIT