Jump to content

Latte templates – Code completion and suggestions


nurkka
 Share

Recommended Posts

Hi all!

I currently have fun using latte templates within ProcessWire via RockFrontend. After trying for many weeks now, I was finally able to implement some code completion / code suggestions by doing this:

{varType ProcessWire\DefaultPage $page}

<section class="container">
	<div class="row">
		<div class="col">
			{$page->doSomething()}
		</div>
	</div>
</section>

So, by adding the first line, my IDE (PHPStorm) recognizes the $page variable and gives me code completion/suggestions, e.g. listing all available methods of $page (which in this case has the class DefaultPage).

But I had no luck with the ProcessWire functions like page(), config(), etc. – they are not recognized at all by the IDE.

Does anyone know how to make an IDE aware of those functions in LATTE?
It would be great if one could use LATTE exactly as if one was writing PHP.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...