Jump to content

Recommended Posts

Posted

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
Posted

I just discovered this post from @interrobang with an update for the PHPStorm Metadata File .phpstorm.meta.php in /wire/core/ . Although this has not directly anything to do with LATTE, I leave the link here because it really helps with autocompletion/code suggestions in PHPStorm, e.g. it now also suggests hooks. Thanks @interrobang!

 

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
  • Recently Browsing   0 members

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