CodeIgniter Forums
PHPStorm Ci4 Live Templates (Snippets)?? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forum-31.html)
+--- Thread: PHPStorm Ci4 Live Templates (Snippets)?? (/thread-78001.html)

Pages: 1 2 3


PHPStorm Ci4 Live Templates (Snippets)?? - PwrSrg - 11-17-2020

Does anyone know of, or have written, Ci4 Live Templates (Code Snippets) for PHPStorm yet??

Here is an old, archived plugin that supported Ci3, that would be perfect if updated to Ci4:
https://github.com/Alicannklc/phpstorm-codeigniter-snippets

Thanks!


RE: PHPStorm Ci4 Live Templates (Snippets)?? - InsiteFX - 11-17-2020

I don't think anyone has done that yet, I have made almost all the code templates ctrl+j


RE: PHPStorm Ci4 Live Templates (Snippets)?? - PwrSrg - 11-17-2020

(11-17-2020, 09:49 PM)InsiteFX Wrote: I don't think anyone has done that yet, I have made almost all the code templates ctrl+j

Well then if you have already created a bunch of them on your own, would you be willing to share what you have with the community?

That is what I created this discussion for.  ?

Thanks!


RE: PHPStorm Ci4 Live Templates (Snippets)?? - marcogmonteiro - 11-18-2020

Don't know the difference between that and the sublime text snippets.

I've done the ci3 and ci4 snippets plugins for sublime, if they are similar you're free to fork it and transform that.

https://packagecontrol.io/packages/CodeIgniter%20Snippets

https://packagecontrol.io/packages/CodeIgniter%204%20Snippets

Also if anyone wants to contribute to the ci4 snippets package that would be awesome.


RE: PHPStorm Ci4 Live Templates (Snippets)?? - PwrSrg - 11-18-2020

(11-18-2020, 02:06 AM)marcogmonteiro Wrote: Don't know the difference between that and the sublime text snippets.

I've done the ci3 and ci4 snippets plugins for sublime, if they are similar you're free to fork it and transform that.

https://packagecontrol.io/packages/CodeIgniter%20Snippets

https://packagecontrol.io/packages/CodeIgniter%204%20Snippets

Also if anyone wants to contribute to the ci4 snippets package that would be awesome.

Awesome, thanks!  I will look into converting those!


RE: PHPStorm Ci4 Live Templates (Snippets)?? - InsiteFX - 11-18-2020

What I have are the editor file and code templates

Config
Controller
BaseController
Frontend Controller
Backend Controller
Manager Controller
Helpers
Libraries
Manager Library
Entity
Filter
Model
Services Template
Bootstrap 4 HTML5
Bootstrap 3 HTML5

If these are of use to you I'll see if I can pull them out for you.

Also have code headers, footers and MIT.

Here is what I have from above, make a back up of your fileTemplates just in case of accident.

My path on my Windows 10 x64 is this.

Code:
C:\Users\Ray\AppData\Roaming\JetBrains\PhpStorm2020.2\fileTemplates

You will have find yours that should get you started.

Un-zip and copy the folder to your phpStorm fileTemplates path.

Download here.

CodeIgniter 4 - phpStorm File Templates.

Hope you find them useful.


RE: PHPStorm Ci4 Live Templates (Snippets)?? - PwrSrg - 11-18-2020

(11-18-2020, 01:10 PM)InsiteFX Wrote: What I have are the editor file and code templates

Config
Controller
BaseController
...
Hey Insite, thank for the update!

It looks like Marco has already done most of the legwork in Sublime Text,
so I am in the process of converting his work to PHPStorm.

I will post them here when I am done!

-Sergio


RE: PHPStorm Ci4 Live Templates (Snippets)?? - InsiteFX - 11-18-2020

I already have half of his work transferred over will finish up in the morning.


RE: PHPStorm Ci4 Live Templates (Snippets)?? - PwrSrg - 11-18-2020

(11-18-2020, 03:31 PM)InsiteFX Wrote: I already have half of his work transferred over will finish up in the morning.

Hah, sounds like you and I had the same idea!  Well I only have 3 done, so I have attached them here for comparison.

I was being very specific with all of the variables to make them as smart as possible - predictive names, mirrored inputs, etc.

Take a look, see if they are basically the SAME, and ping me on Slack in the morning!  

-Sergio


RE: PHPStorm Ci4 Live Templates (Snippets)?? - InsiteFX - 11-18-2020

Aw, I see mine is different I' m creating the auto complete using live templates.

Your creating them using xml.