{"id":17010816,"url":"https://github.com/gerardroche/sublime-php-snippets","last_synced_at":"2025-03-22T16:31:01.122Z","repository":{"id":23136145,"uuid":"26491138","full_name":"gerardroche/sublime-php-snippets","owner":"gerardroche","description":"PHP snippets for Sublime Text.","archived":false,"fork":false,"pushed_at":"2023-05-21T22:18:26.000Z","size":254,"stargazers_count":61,"open_issues_count":1,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T13:32:39.149Z","etag":null,"topics":["php","snippets","sublime-text"],"latest_commit_sha":null,"homepage":"https://www.gerardroche.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gerardroche.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-11T15:34:14.000Z","updated_at":"2025-02-24T12:05:20.000Z","dependencies_parsed_at":"2024-10-28T14:10:43.473Z","dependency_job_id":"d22eeae5-cda8-45a1-ae39-dbe2e4eba928","html_url":"https://github.com/gerardroche/sublime-php-snippets","commit_stats":{"total_commits":217,"total_committers":2,"mean_commits":108.5,"dds":0.004608294930875556,"last_synced_commit":"3eb1c209cae584c88c4d0ee66166bfaaef1bf7cd"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardroche%2Fsublime-php-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardroche%2Fsublime-php-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardroche%2Fsublime-php-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardroche%2Fsublime-php-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerardroche","download_url":"https://codeload.github.com/gerardroche/sublime-php-snippets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244986439,"owners_count":20543012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","snippets","sublime-text"],"created_at":"2024-10-14T06:05:31.570Z","updated_at":"2025-03-22T16:31:00.631Z","avatar_url":"https://github.com/gerardroche.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WHAT PHP SNIPPETS IS\n\nPHP snippets for Sublime Text.\n\n[![Minimum Sublime Version](https://img.shields.io/badge/sublime-%3E%3D%203.0-brightgreen.svg?style=flat-square)](https://sublimetext.com) [![Latest Version](https://img.shields.io/github/tag/gerardroche/sublime-php-snippets.svg?style=flat-square\u0026label=version)](https://github.com/gerardroche/sublime-php-snippets/tags) [![GitHub stars](https://img.shields.io/github/stars/gerardroche/sublime-php-snippets.svg?style=flat-square)](https://github.com/gerardroche/sublime-php-snippets/stargazers) [![Downloads](https://img.shields.io/packagecontrol/dt/PHPSnippets.svg?style=flat-square)](https://packagecontrol.io/packages/PHPSnippets)\n\n* PSR compliant\n* Scoped to minimise auto-complete noise\n\n## INSTALLATION\n\n### Package Control installation\n\nThe preferred method of installation is [Package Control](https://packagecontrol.io/browse/authors/gerardroche).\n\n### Manual installation\n\nClose Sublime Text, then download or clone this repository to a directory named **PHPSnippets** in the Sublime Text Packages directory for your platform:\n\nOS | Command\n-- | -----\nLinux | `git clone https://github.com/gerardroche/sublime-php-snippets.git ~/.config/sublime-text-3/Packages/PHPSnippets`\nOSX | `git clone https://github.com/gerardroche/sublime-php-snippets.git ~/Library/Application\\ Support/Sublime\\ Text\\ 3/Packages/PHPSnippets`\nWindows | `git clone https://github.com/gerardroche/sublime-php-snippets.git %APPDATA%\\Sublime/ Text/ 3/Packages/PHPSnippets`\n\n## USAGE\n\n| OS X | Windows | Linux | Description |\n|------|---------|-------|-------------|\n| `Command+Space` | `Ctrl+Space` | `Alt+/` | Activate completions |\n\nEnable [tab-completions](http://docs.sublimetext.info/en/latest/extensibility/completions.html#tab-completed-completions).\n\n**Menu → Preferences → Settings**\n\n```js\n\"tab_completion\": true\n```\n\n| Trigger | Description |\n| ------- | ----------- |\n| `\u003c?` | PHP: start tag |\n| `\u003c?` | PHTML: \u0026lt;?php ... ?\u0026gt; |\n| `\u003c?=` | PHP: short echo tag |\n| `/**` | PHP: phpdoc |\n| `?=` | PHP: short echo tag |\n| `_C` | PHP: COOKIE['|'] |\n| `_E` | PHP: ENV['|'] |\n| `_F` | PHP: FILES['|'] |\n| `_G` | PHP: GET['|'] |\n| `_P` | PHP: POST['|'] |\n| `_R` | PHP: REQUEST['|'] |\n| `_S` | PHP: SERVER['|'] |\n| `_SS` | PHP: SESSION['|'] |\n| `am` | PHP: array map |\n| `arr` | PHP: variable = array |\n| `c` | PHP: class |\n| `c` | PHP: class declaration |\n| `case` | PHP: case |\n| `class` | PHP: class |\n| `closure` | PHP: closure |\n| `con` | PHP: constructor |\n| `def` | PHP: define |\n| `def?` | PHP: defined |\n| `do` | PHP: do while |\n| `doc_c` | PHP: phpdoc class |\n| `doc_d` | PHP: phpdoc constant |\n| `doc_f` | PHP: phpdoc function |\n| `doc_i` | PHP: phpdoc interface |\n| `doc_s` | PHP: phpdoc function |\n| `doc_v` | PHP: phpdoc property |\n| `dst` | PHP: declare strict_types |\n| `echo` | PHP: echo string |\n| `echo` | PHTML: echo variable |\n| `echoh` | PHTML: echo htmlentities |\n| `else` | PHP: else |\n| `else` | PHTML: else |\n| `elseif` | PHP: elseif |\n| `elseif` | PHTML: elseif |\n| `endfor` | PHTML: endfor |\n| `endforeach` | PHTML: endforeach |\n| `endif` | PHTML: endif |\n| `endswitch` | PHTML: endswitch |\n| `endwhile` | PHTML: endwhile |\n| `ethis` | PHP: echo $this-\u0026gt; |\n| `ethis` | PHTML: echo $this-\u0026gt; |\n| `ev` | PHP: echo variable |\n| `f` | PHP: function |\n| `flatten` | PHP: flatten array |\n| `for` | PHP: for |\n| `foreach` | PHP: foreach value |\n| `foreach` | PHTML: foreach value |\n| `foreachk` | PHP: foreach key =\u003e value |\n| `foreachk` | PHTML: foreach key =\u003e value |\n| `foreachv` | PHP: foreach value |\n| `fpri` | PHP: final private method |\n| `fpris` | PHP: final private static method |\n| `fpro` | PHP: final protected method |\n| `fpub` | PHP: final public method |\n| `fpubs` | PHP: final public static method |\n| `fun` | PHP: function |\n| `getter` | PHP: getter |\n| `globals` | PHP: $GLOBALS['|'] |\n| `gm` | PHP: getter |\n| `i` | PHP: interface |\n| `if` | PHP: if |\n| `if` | PHTML: if |\n| `if?` | PHP: var = cond ? a:b |\n| `ifelse` | PHP: if-else |\n| `ifelse` | PHTML: if-else |\n| `inc` | PHP: include 'file' |\n| `inc1` | PHP: include_once 'file' |\n| `is` | PHP: isset var |\n| `kv` | PHP: 'key' =\u003e 'value' |\n| `m` | PHP: method |\n| `met` | PHP: method |\n| `n` | PHP: namespace |\n| `namespace` | PHP: namespace |\n| `p` | PHP: property |\n| `php` | PHTML: \u0026lt;?php ... ?\u0026gt; |\n| `pr` | PHP: print_r |\n| `pre` | PHP: print_r and exit |\n| `pri` | PHP: private method |\n| `pro` | PHP: protected method |\n| `psm` | PHP: public static method |\n| `pub` | PHP: public method |\n| `pubs` | PHP: public static method |\n| `r` | PHP: return |\n| `req` | PHP: require file |\n| `req1` | PHP: require_once file |\n| `reqd` | PHP: require dirname file |\n| `ret` | PHP: return |\n| `ret0` | PHP: return false |\n| `ret1` | PHP: return true |\n| `retf` | PHP: return false |\n| `rett` | PHP: return true |\n| `rt` | PHP: return $this |\n| `rv` | PHP: return var |\n| `self` | PHP: self:: |\n| `setter` | PHP: setter |\n| `sm` | PHP: setter |\n| `switch` | PHP: switch |\n| `t` | PHP: $this-\u0026gt; |\n| `this` | PHP: $this-\u0026gt; |\n| `this` | PHTML: \u0026lt;?php $this-\u0026gt;| ?\u0026gt; |\n| `throw` | PHP: throw exception |\n| `trait` | PHP: trait |\n| `try` | PHP: try catch |\n| `use` | PHP: use |\n| `vd` | PHP: dump var |\n| `vde` | PHP: dump var and exit |\n| `while` | PHP: while |\n\n## CONFIGURATION\n\nCreate a file named `php-snippets-phtml-settings.tmPreferences` in your User packages directory (`Menu → Preferences → Browse Packages...`) with the following (modified to meet your needs):\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cplist version=\"1.0\"\u003e\n\u003cdict\u003e\n    \u003ckey\u003ename\u003c/key\u003e\n    \u003cstring\u003ephp-snippets phtml settings\u003c/string\u003e\n    \u003ckey\u003escope\u003c/key\u003e\n    \u003cstring\u003etext.html.basic\u003c/string\u003e\n    \u003ckey\u003esettings\u003c/key\u003e\n    \u003cdict\u003e\n        \u003ckey\u003eshellVariables\u003c/key\u003e\n        \u003carray\u003e\n\n\n            \u003c!--\n                If you prefer HTML echo statement snippets to use long-form echo\n                statements: \u003c?php echo | ?\u003e. Comment out the following section:\n            --\u003e\n\n            \u003cdict\u003e\n                \u003ckey\u003ename\u003c/key\u003e\n                \u003cstring\u003eTM_PHP_OPEN_TAG_WITH_ECHO\u003c/string\u003e\n                \u003ckey\u003evalue\u003c/key\u003e\n                \u003cstring\u003e=\u003c/string\u003e\n            \u003c/dict\u003e\n\n\n            \u003c!--\n                If you prefer opening braces to be formatted on the same line,\n                uncomment the following section:\n            --\u003e\n\n            \u003c!--\n            \u003cdict\u003e\n                \u003ckey\u003ename\u003c/key\u003e\n                \u003cstring\u003eTM_PHP_SNIPPET_OPENING_BRACE\u003c/string\u003e\n                \u003ckey\u003evalue\u003c/key\u003e\n                \u003cstring\u003e {\u003c/string\u003e\n            \u003c/dict\u003e\n            --\u003e\n\n        \u003c/array\u003e\n    \u003c/dict\u003e\n\u003c/dict\u003e\n\u003c/plist\u003e\n\n```\n\n## LICENSE\n\nReleased under the [BSD 3-Clause License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerardroche%2Fsublime-php-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerardroche%2Fsublime-php-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerardroche%2Fsublime-php-snippets/lists"}