Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Eclipse code completion in Views
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 29 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Stu  
View profile  
 More options Oct 7 2007, 10:44 am
From: Stu <sgras...@gmail.com>
Date: Sun, 07 Oct 2007 14:44:36 -0000
Local: Sun, Oct 7 2007 10:44 am
Subject: Eclipse code completion in Views
Hi Bakers,

Does anyone know if it is possible to get code completion working for
Views in eclipse? I've got it working for Models in a controller, but
can't seem to get any code completion when in a View, and do something
like <div><?php echo $html->.... I'm just wondering if there is some
configuration option I'm missing or something like that.

Any help would be appreciated,

thanks

Stu


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
schneimi  
View profile  
 More options Oct 7 2007, 12:28 pm
From: schneimi <michael.schne...@arcor.de>
Date: Sun, 07 Oct 2007 09:28:06 -0700
Local: Sun, Oct 7 2007 12:28 pm
Subject: Re: Eclipse code completion in Views
Hi,

You have to do two steps:

- Add *.thtml to Preferences->General->Content Types->PHP Content
Type
- Add *.thtml and assign the PHP-Editor in Preferences->General-

>Editors->File Associations

regards,

Michael

Stu schrieb:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stu  
View profile  
 More options Oct 8 2007, 3:58 am
From: Stu <sgras...@gmail.com>
Date: Mon, 08 Oct 2007 07:58:19 -0000
Local: Mon, Oct 8 2007 3:58 am
Subject: Re: Eclipse code completion in Views
Ah ok, I'd done the first step but not the second step. I'm at work at
the moment, but I'll do the second step when I get home.

Thanks

On Oct 7, 5:28 pm, schneimi <michael.schne...@arcor.de> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
schneimi  
View profile  
 More options Oct 8 2007, 8:58 am
From: schneimi <michael.schne...@arcor.de>
Date: Mon, 08 Oct 2007 05:58:25 -0700
Local: Mon, Oct 8 2007 8:58 am
Subject: Re: Eclipse code completion in Views
Yes, you are right, the second step is not necessary.

Stu schrieb:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stu  
View profile  
 More options Oct 8 2007, 4:11 pm
From: Stu <sgras...@gmail.com>
Date: Mon, 08 Oct 2007 20:11:29 -0000
Local: Mon, Oct 8 2007 4:11 pm
Subject: Re: Eclipse code completion in Views
Well, I unfortunately can't get code completion on methods in $form->,
or $html-> in a view (*.ctp file).

It's no big deal, but it would be very nice.

On Oct 8, 1:58 pm, schneimi <michael.schne...@arcor.de> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
schneimi  
View profile  
 More options Oct 8 2007, 4:53 pm
From: schneimi <michael.schne...@arcor.de>
Date: Mon, 08 Oct 2007 13:53:39 -0700
Local: Mon, Oct 8 2007 4:53 pm
Subject: Re: Eclipse code completion in Views
Yes that would be nice, but i think it's not possible, because these
variables are handled by cake.

Stu schrieb:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
voidstate  
View profile  
 More options Oct 10 2007, 12:42 pm
From: voidstate <voidst...@gmail.com>
Date: Wed, 10 Oct 2007 16:42:14 -0000
Local: Wed, Oct 10 2007 12:42 pm
Subject: Re: Eclipse code completion in Views
But the names are standardised. Could you perhaps put some kind of
alias for the helper objects in the app during development using those
names then remove them for production?

On Oct 8, 9:53 pm, schneimi <michael.schne...@arcor.de> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
schneimi  
View profile  
 More options Oct 10 2007, 1:17 pm
From: schneimi <michael.schne...@arcor.de>
Date: Wed, 10 Oct 2007 10:17:32 -0700
Local: Wed, Oct 10 2007 1:17 pm
Subject: Re: Eclipse code completion in Views
I just tested this code in a view:

if(false) {
  $html = new HtmlHelper();

}

Not that beautiful, but it will never be executed and Eclipse does the
completion anyway. Maybe that helps.

Michael

Not very beautiful but will never run and
voidstate schrieb:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
schneimi  
View profile  
 More options Oct 10 2007, 2:14 pm
From: schneimi <michael.schne...@arcor.de>
Date: Wed, 10 Oct 2007 11:14:13 -0700
Local: Wed, Oct 10 2007 2:14 pm
Subject: Re: Eclipse code completion in Views
You can put it in the index.php and it works for every view. :-)

schneimi schrieb:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stu  
View profile  
 More options Oct 10 2007, 3:34 pm
From: Stu <sgras...@gmail.com>
Date: Wed, 10 Oct 2007 19:34:29 -0000
Local: Wed, Oct 10 2007 3:34 pm
Subject: Re: Eclipse code completion in Views
That is brilliant, and worked flawlessly first time, and just makes
something awesome even more awesome.

Thanks very much

Stu

On Oct 10, 7:14 pm, schneimi <michael.schne...@arcor.de> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wluigi  
View profile  
 More options Oct 11 2007, 8:29 am
From: wluigi <wlu...@gmail.com>
Date: Thu, 11 Oct 2007 12:29:14 -0000
Local: Thurs, Oct 11 2007 8:29 am
Subject: Re: Eclipse code completion in Views
That's great.

So in the controller, you can use

if(false) {
        $this->Model = new Model();

}

but you've to add this in every action of every controller.

How to add it to one and only one place ?

On Oct 10, 9:34 pm, Stu <sgras...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mech7  
View profile  
 More options Oct 11 2007, 9:17 am
From: Mech7 <chris.de....@gmail.com>
Date: Thu, 11 Oct 2007 13:17:28 -0000
Local: Thurs, Oct 11 2007 9:17 am
Subject: Re: Eclipse code completion in Views
I think in ZDE this worked by default just not on Eclipse + PDT :(

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luigi  
View profile  
 More options Oct 11 2007, 9:19 am
From: Luigi <wlu...@gmail.com>
Date: Thu, 11 Oct 2007 15:19:04 +0200
Local: Thurs, Oct 11 2007 9:19 am
Subject: Re: Eclipse code completion in Views

no it doesn't.

at least for me.

On 10/11/07, Mech7 <chris.de....@gmail.com> wrote:

> I think in ZDE this worked by default just not on Eclipse + PDT :(

--
Luigi

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
schneimi  
View profile  
 More options Oct 11 2007, 12:24 pm
From: schneimi <michael.schne...@arcor.de>
Date: Thu, 11 Oct 2007 09:24:17 -0700
Local: Thurs, Oct 11 2007 12:24 pm
Subject: Re: Eclipse code completion in Views
In Controllers you can do something else with phpDoc, like:

  /**
   * @var Model
   */
  var $model;

If you put this in your AppController, it should work in every action
in your controllers.

This all works for me with PDT Eclipse.

On 11 Okt., 14:29, wluigi <wlu...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mech7  
View profile  
 More options Oct 11 2007, 1:39 pm
From: Mech7 <chris.de....@gmail.com>
Date: Thu, 11 Oct 2007 17:39:09 -0000
Local: Thurs, Oct 11 2007 1:39 pm
Subject: Re: Eclipse code completion in Views
Strange it does for me ?

On Oct 11, 3:19 pm, Luigi <wlu...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
voidstate  
View profile  
 More options Oct 11 2007, 3:33 pm
From: voidstate <voidst...@gmail.com>
Date: Thu, 11 Oct 2007 19:33:37 -0000
Local: Thurs, Oct 11 2007 3:33 pm
Subject: Re: Eclipse code completion in Views
To develop the idea a bit further.

Better surely to just create a file in the root of you dev site
(called "eclipse_helper.php" or something) so it never get called and
you don't have to put code into working pages.

Something like:

-----

<?
// stop page loading
exit;

// reference helpers so Eclipse provides code completion
$ajax = new AjaxHelper();
$cache = new CacheHelper();
$form = new FormHelper();
$html = new HtmlHelper();
$javascript = new JavascriptHelper();
$number = new NumberHelper();
$session = new SessionHelper();
$text = new TextHelper();
$time = new TimeHelper();
?>

-----

voidstate

On Oct 11, 6:39 pm, Mech7 <chris.de....@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mech7  
View profile  
 More options Oct 12 2007, 9:17 am
From: Mech7 <chris.de....@gmail.com>
Date: Fri, 12 Oct 2007 13:17:51 -0000
Local: Fri, Oct 12 2007 9:17 am
Subject: Re: Eclipse code completion in Views
Btw does anybody know how to have the codeassist popup automatically?
Like with Zend neon? no ctrl + space needed?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mandy  
View profile  
 More options Oct 15 2007, 12:35 am
From: Mandy <man...@gmail.com>
Date: Sun, 14 Oct 2007 21:35:08 -0700
Local: Mon, Oct 15 2007 12:35 am
Subject: Re: Eclipse code completion in Views
I use Easy Eclipse for PHP. I created eclipse_helper.php, copied all
of the above and pasted it in the file. Then placed the file in
webroot folder, did a Project->Clean->Build (made sure .thtml files
are opened by PHP editor).

However, I still couldn't see code completion when I typed $html->
(and then ctrl + space).

?

-Mandy.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
avairet  
View profile  
 More options Nov 13 2007, 11:56 am
From: avairet <avai...@groupeafg.com>
Date: Tue, 13 Nov 2007 08:56:49 -0800
Local: Tues, Nov 13 2007 11:56 am
Subject: Re: Eclipse code completion in Views
Hi everybody!

Firstly, excuse me for my simple English...

Then I tell you my own experience with PDT/Cake Code Completion.
My config : Eclipse Europa 3.3 + PDT 1.0 + Cake 1.2 with advanced
install/config("Cake core", "app dir" and "webroot dir" in three
different paths) )

- the "voidstate" example is very cool for helpers methods completion
in view (file with $helper = new Helper())

- the "schneimi"'s method for models completion in controllers works
fine, but it's necessary to copy it in each controllers you create and
replace "model" by your model name... I've tried to put this in
AppController, but it doesn't work. Any ideas to add completion for
all controllers in one place?

- this 2 methods doesn't work if I use Subclipse and check out a cake
app directory as an Eclipse project. In this case, there are no code
completion, even Php builtin functions! Any ideas why code completion
doesn't work with a SVN shared project?

- and last, is it possible to take code completion for "components'",
"behaviors", "elements" and so on?

Thank's for your kind attention and best regards!

Avairet

On 15 oct, 05:35, Mandy <man...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
schneimi  
View profile  
 More options Nov 13 2007, 12:47 pm
From: schneimi <michael.schne...@arcor.de>
Date: Tue, 13 Nov 2007 09:47:03 -0800
Local: Tues, Nov 13 2007 12:47 pm
Subject: Re: Eclipse code completion in Views
Hi Avairet,

> - the "schneimi"'s method for models completion in controllers works
> fine, but it's necessary to copy it in each controllers you create and
> replace "model" by your model name... I've tried to put this in
> AppController, but it doesn't work. Any ideas to add completion for
> all controllers in one place?

Model completion works in all controllers for me with the phpdoc in
the AppController. Maybe your controllers extend Controller and not
AppController.

> - this 2 methods doesn't work if I use Subclipse and check out a cake
> app directory as an Eclipse project. In this case, there are no code
> completion, even Php builtin functions! Any ideas why code completion
> doesn't work with a SVN shared project?

I also remember problems with SVN checkout as a project, it seems like
it isn't handled as a PHP project that way. I use to create a PHP
project first and then use the import for that project to get the data
from SVN.

> - and last, is it possible to take code completion for "components'",
> "behaviors", "elements" and so on?

It should be possible to extend the completion to the other stuff,
e.g. this works for the Session-Component:
  /**
   * @var SessionComponent
   */
  var $Session;

-
Michael

On 13 Nov., 17:56, avairet <avai...@groupeafg.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
avairet  
View profile  
 More options Nov 14 2007, 3:49 am
From: avairet <avai...@groupeafg.com>
Date: Wed, 14 Nov 2007 00:49:01 -0800
Local: Wed, Nov 14 2007 3:49 am
Subject: Re: Eclipse code completion in Views
Hello Michael,

Thank's a lot for your answer. I've just need some precisions:

>>> Model completion works in all controllers for me with the phpdoc in

the AppController. Maybe your controllers extend Controller and not
AppController.

No, my controllers extends AppController. e.g. :

[code]
class ArticlesController extends AppController {
        public $name = 'Articles';

}

[/code]

If I write this in my AppController class, the code completion doesn't
work in the controller "ArticlesController":
[code]
class AppController extends Controller {
  /**
   * @var Model
   */
    var Model

}

[/code]

Must I write the name of all my models with PHPDoc in AppController?

>>>>I use to create a PHP

project first and then use the import for that project to get the data
from SVN.

OK, I will test that.

>>>>t should be possible to extend the completion to the other stuff,

e.g. this works for the Session-Component.

Must I write the PHPDoc comment in all my controllers which are using
SessionComponent? Or I must write it in AppController too?

I hope my message is understandable...

Have a nice day !

Aurélien (avairet)

On 13 nov, 18:47, schneimi <michael.schne...@arcor.de> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
avairet  
View profile  
 More options Nov 14 2007, 5:09 am
From: avairet <avai...@groupeafg.com>
Date: Wed, 14 Nov 2007 02:09:11 -0800
Local: Wed, Nov 14 2007 5:09 am
Subject: Re: Eclipse code completion in Views
Michael,

Sorry, I've made an error in code. This is the code I write in my
AppController (var $model):

[code]
class AppController extends Controller {
  /**
   * @var Model
   */
    var $model

}

[/code]

Otherwise, I've tested your solution for SVN, but it doesn't work.
Even I use "Import SVN" in an existing PHP project, no code completion
is available, even PHP built'in functions like "mysql_close" or
"str_replace" are unavailable!

Moreover, the Eclipse Outline View doesn't work too with a SVN
checkout project! It's impossible to take some Eclipse/PDT utilities
with that kind of project!
Currently I think create 2 projects in Eclipse: one for SVN checkout
and one for my real web project. And then I will merge all files
before making my SVN commits...

See you another solution?

BR,

Aurélien (avairet)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
avairet  
View profile  
 More options Nov 14 2007, 9:15 am
From: avairet <avai...@groupeafg.com>
Date: Wed, 14 Nov 2007 06:15:03 -0800
Local: Wed, Nov 14 2007 9:15 am
Subject: Re: Eclipse code completion in Views
I've resolved the problem with code completion in SVN project!
In my SVN repository, there was a file called ".project" (an error of
my collegues), so when I checked out, Subclipse did never ask me what
kind of project I want to create! I've deleted it and now all work
fine!

Thank's to Hannes and Nagy for their answers which have enlighten me
about the ways to explore!

The steps:
1. create and connect to a SVN Repository via the SVN Repository
Exploring perspective
2. right-click on the repository, choose "Checkout"
3. check the first radio button "check out as a project configured
using the New Project Wizard" and click "Finish" button.
4. in the wizard select window, choose "PHP>PHP project" and then
click "Next" button
5. select where you want to store the project and name it (for me, the
location is not the default workspace, so I uncheck the radio button
and select the directory in my file system)
6. click next to include Cakephp core
7. return to your PHP perspective where a new project is now available
on the left panel
8. edit or create a file : all Eclipse PDT plugin utilities are
available!
9. use "Voidstate" method (describe above) to get helpers
autocompletion in views and Michael "Schneimi" trick to get models/
components methods autocompletion in your controllers.
GREAT !!!

Aurélien (avairet)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
schneimi  
View profile  
 More options Nov 14 2007, 10:42 am
From: schneimi <michael.schne...@arcor.de>
Date: Wed, 14 Nov 2007 07:42:46 -0800
Local: Wed, Nov 14 2007 10:42 am
Subject: Re: Eclipse code completion in Views

> Must I write the name of all my models with PHPDoc in AppController?

Yes you must! Each model,component,... must be put in like that code
example, each var must have the phpDoc in its comment above, but only
one time in the AppController.

Good to see the SVN problem is solved, I wasn't sure about that.

Michael


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
avairet  
View profile  
 More options Nov 16 2007, 9:09 am
From: avairet <avai...@groupeafg.com>
Date: Fri, 16 Nov 2007 06:09:26 -0800 (PST)
Local: Fri, Nov 16 2007 9:09 am
Subject: Re: Eclipse code completion in Views
OK, thank's Michael!

But is it a good idea to "load" all models in AppController whereas
this models are not used in all Controllers that extends
AppController?
Or your trick doesn't "load" the models but just indicates it for code
completion to PDT Eclipse?

In the same way, HtmlHelper is declared in CakeCore's Controller Class
so it's not necessary to write "$helpers = array('html');" in our own
controllers, views and helpers? In this case, why couldn't we write
all available Models, Helpers, Components in a unique place (e.g.
AppController)?
Because in practice, there are a lot of same declarations, like
'$helpers = array('html','form')", in our applications!

I'm sorry but this kind of details are not trivial for me...

Thank's for explanations...

Aurélien


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 29   Newer >
« Back to Discussions « Newer topic     Older topic »