Created
January 19, 2013 03:30
-
-
Save carwin/4570607 to your computer and use it in GitHub Desktop.
Textmate command to quickly modify a field's weight within `hook_form_alter`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WTF? | |
* - This will let you define a shortcut like | |
* `derp` so that when you type `derp` and | |
* hit TAB, you get: | |
* $form['field_name']['#weight'] = weight; | |
* | |
* - 'field_name' and 'weight' are variables, | |
* which means that Textmate will auto-focus | |
* your current position to the first one and | |
* let you TAB over to the second one. | |
* | |
* INSTALL | |
* 1. Edit Bundles | |
* 2. Choose PHP bundle | |
* 2. CMD + N, select Command | |
* 4. Fill out the info on the right | |
* 5. Drop this into the script area | |
* | |
*/ | |
\$form['${1:field_name}']['#weight'] = ${2:weight}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment