Make Sublime Text work with Cakephp (ctp) view files - cakephp

I'm trying to get Sublime Text 3 to work well with Cake's ctp (view) files. The syntax highlighting works fine out-of-the-box, but I can't get the HTML autocomplete to work.
If I open an .html file, I can get the tags and attributes to autocomplete (except in the attribute "style", it doesn't autocomplete CSS styles).
However, if I work on a .ctp file, autocomplete doesn't work at all. I've already tried changing the View->Syntax settings to both PHP and HTML and nothing... I've even tried using the "Open all with current extension as..." with no result.
I've tried using different plugins (ApplySyntax, cakephp plugins, etc) with any success.
Another thing I've noticed, also for javascript code, is that for "short" tags and functions, if I place the cursor at the opening tag or {, the closing tag or } gets automatically highlighted. However, if there's a bunch of lines of code in-between (same language) then the highlight won't happen...
Any help with these things would be really appreciated! I really want to like and use Sublime!

NO NEED FOR A PLUGIN NOW!
In the latest version of SublimeText 3 (at least), you can open a CTP file, then:
View -> Syntax -> Open all current extension as -> PHP
Then just close your open files, and when you re-open them, they'll be highlighted like the language you chose for that extension.

Just install the ApplySyntax plugin for sublime-text.
ApplySyntax can be installed in a variety of ways:
Through Package Control http://wbond.net/sublime_packages/package_control
Open Package Control
Select 'Install Package'
Find and select 'ApplySyntax'
By cloning this repository in Packages
cd into your Packages folder
git clone git://github.com/facelessuser/ApplySyntax.git .
By downloading the files and placing them in a directory under Packages, such as ApplySyntax or User
If you don't put the files in Packages/User (you can, but probably shouldn't), make sure they live in Packages/ApplySyntax. If you download and extract a compressed archive from GitHub, the directory will be facelessuser-ApplySyntax. Remove facelessuser-.
Courtesy for installation steps: https://github.com/facelessuser/ApplySyntax/blob/master/readme.md
N.B: I installed it and now the *.ctp files are displayed with proper syntax-highlighting for me.
Update:
In Sublime Text 3, you don't have to use the plugin, you can use the following solution:
https://stackoverflow.com/a/35297789/749232

Related

team work with codename one

i am a student and i am a member of a group of five...
We have to work in the same project using git and we are using Scrum method in our work, so , we need some guide and best practice and answers before starting...we will be so happy with your informations.
can we use différent IDE (intellij and Netbeans)... if yes, the .gitinore file will contains every IDE 's specefic .gitignore file?
You can use this to get started: https://www.codenameone.com/blog/tip-using-git-for-codename-one-projects.html
e.g. sample gitignore from https://github.com/codenameone/MaterialScreensUIKit
*.jar
nbproject/private/
build/
nbbuild/
dist/
lib/CodenameOne_SRC.zip
psds/.DS_Store
.DS_Store
In your theme editor make sure the File -> XML Team Mode is checked for everyone so you can work on XML and individual files rather than the whole thing.
Alternatively you can avoid the designer tool altogether and use CSS.

Angular autocomplete (i.e. intelli-sense) not working in PhpStorm

I have done the following:
Installed both the AngularJS and NodeJS Plugins in Phpstorm
Downloaded the latest stable release of Angular (1.4.8)
Added angular.js to the project
Added angular.js to the list of libraries in Phpstorm
Directives in my HTML will autocomplete fine (e.g. ng-modal), but trying to do something like Module.fact does not autocomplete to factory. Here is my code:
var appModule = angular.module("appModule", ['ngRoute']);

appModule.fac //This is me typing factory, but auto complete doesn't help
I am running PhpStorm 10.0.2. I have tried using different versions of PhpStorm and I have also tried using Angular 1.5 (the beta version) with the same result. Also, I am new to angular, but my code is working. Thank you!
*I have already reviewed these links and SO posts:
https://www.jetbrains.com/webstorm/help/using-angularjs.html
https://www.jetbrains.com/webstorm/help/configuring-javascript-libraries.html
Why do AngularJS directives (attributes, etc.) show up as "invalid" in WebStorm 8?
Getting angularJS autcomplete in Webstorm/PHPStorm
The angular variable is a global one and when you have to many declarations of the same global variable PhpStorm/WebStorm can not handle auto-completion.
It's important to verify that only 1 declaration for angular is being discovered by PhpStorm. This doesn't have anything to do with your actually JavaScript project, but where PhpStorm looks for declarations.
If you hold down ctrl and mouse over the world angular. It should show it highlighted to be clickable, and a tooltip showing where it is declared.
If the tooltip says there are multiple definitions of the identifier, then it can not do autocomplete correctly. This is true for most JS variables in Php/WebStorm not just this angular variable.
You have a couple of ways to fix this:
1) Force type declaration with JsDoc to TypeScript
/**
* #var {angular.IAngularStatic} myAngular
*/
var myAngular = angular;
This will declare the variable myAngular using the TypeScript definition. There is less likely to be conflict with any already scanned JS source files that also declare angular. It's an easy fix, but adds unnecessary source code to your project.
2) Disable JavaScript source files by excluding them
If you are using node_modules or bower_components then you need to include some of the JS files from those folders, but not unnecessary duplicates. You won't need any Angular JS files since you've already installed the TypeScript definitions (which work better for auto-completion). In the Project Files panel in PhpStorm find the Angular packages, right click on those folders and "Exclude" those folders. You can also do this via project settings in "Files / Settings / Directories"
3) Ignore bundled output files for JavaScript
This is the most common issue I find with PhpStorm/WebStorm. PhpStorm will also scan minified JavaScript files you've packaged into your webroot/js folder. For example; If you use grunt to uglify your JavaScript code into app.min.js and inside that file is Angular and your project code. PhpStorm will scan this and create duplicate declarations of everything it finds.
Find all those duplicate *.js files in your project, right mouse click on the files and select "Mark as Plain Text" from the menu. This will tell the editor to completely ignore the file from all intellisense scanning.
So to summarize. If you control click on a declaration to go to source, and PhpStorm does not go immediately, but instead prompts you select from multiple declarations, then you have duplicates in your project and you need to narrow the scope. Once that is done everything else should work as expected.
f you prefer to use a CDN, place the cursor over the highlight library name, hit Alt+Enter, and Download Library. This will set up a local library in WebStorm’s cache (not in your project) so WebStorm can access AngularJS methods, directives, etc for autocompletion and documentation lookup.

How to prevent Joomla site creating unwanted folder

I have a menu link with the alias "inside" on a joomla 3.1.5 site here: http://naiwellness.com
Every morning I check the site and a folder named "inside" has been created in the root dir which prevents the site from loading as it should, instead displaying a directory contents listing at http://naiwellness.com/inside
Anyone have any ideas how to prevent this please?
Thanks
This is just a theory, but check the xml files of your installed modules and plugins (most likely a plugin) for this line...
<folder>inside</folder>
and if it exists try deleting that line of code - or better still uninstall the extension - that should fix it. It's possible that a plugin requires that folder and has php code to create the folder if it doesn't exist - and so creates the folder each time it is run - i.e. when the site is loaded. The above line of xml code I have asked you to look for will go someway to helping determine if this is the case.

How to include ext-js calendar in jsp?

I am new to EXT JS environment. I am working on a dynamic java project in eclipse indigo where i want to use ext-js calendar in one of my jsp.I saw the EXT_JS calendar demo from downloaded 'ext-4.1.1' sdk(index.html file in ext-4.1.1a\examples\calendar).
I want to create a .js file as like ext-js calendar page. So for that i followed the path given in
http://loianegroner.com/2010/11/spket-setting-up-eclipse-ide-for-ext-js-and-jquery-development/ to integrate ext-js in eclipse.
But now when i copy index.html to my webcontent folder then it is not working(Originally it is showing nothing). But when i copy the entire ext-js source code to my workspace web content then running the index.html file in example/calendar folder of ext-4.1.1a giving me required result.But I don't think this as a solution.
I could not find any way also how to start to do my task.
So Pls anybody help me here...
Regards :
Dev
When nothing shows up on the screen, it is commonly a case where the ExtJS library isn't loaded. Without seeing the code, it's hard to pinpoint the issue.
Using Chrome Dev tools or Firebug for Firefox, take a look at the console and/or network output.
The files you're looking for will be included in the <head> section of your index.html. There should be ext-all.js or possibly ext-all-debug.js at a minimum, plus the style sheets.
If this is your issue, then you need to include the proper paths to the ExtJS library. This can be the local installation, or you can use a CDN. For example:
<script src="http://cdn.sencha.com/ext-4.1.1-gpl/ext-all.js"></script>

Using kate editor for c dev (with the ctags plugin)

I just started using the kate editor (was using vim) for c dev. I used ctags a lot with vim. So I would like to have the same with the kate editor. I enabled the Ctags plugin in the plugins list. It generates the tags file (.ctagsdb), but it does not load the tags in the "tags tab" when I want to look for the tags I have to manually type in the LookUP field for the tag to show up. It does not populate the tags. I am not even able to use the CTags menu item.
Can someone tell me how to get the CTags working. or if there is a better plugin to do this.
Or is this the way it "normally" works.
Thanks.
First of all does the ctags database include tags of your project/file?
If not then go to the "Index Targets" tab and add your project's path, then click update index. (also make sure you have ctags installed)
Now in the source code find a symbol you want to look up right click on it and go CTags->Lookup (or click on it and Alt+4).
You can also go to the Declaration with Alt+2 or to the Definition with Alt+3.
After watching the Definition/Declaration/Whatever you can go back where you were with Alt+1.
Make sure that you have installed ctags
sudo apt-get install ctags
Good Luck :)

Resources