Jump to content

How can I write straight PHP in a skin template?


seanzol

Recommended Posts

Please forgive me, as I'm sure this is a stupid question, but I couldn't find the right combo of search terms either on Google or here.

Previously, you could write a block of PHP by enclosing it in <php></php> tags, but now that doesn't seem to be the case, as it just spits out an HTML-commented copy of your code. What am I missing?

Link to comment
Share on other sites

It seems. If you perform a search in .phtml files, you'll see a lot of examples like that:

{{$idField = $comment::$databaseColumnId;}}
{{$itemClassSafe = str_replace( '\\', '_', mb_substr( $comment::$itemClass, 4 ) );}}

One line for each php line.

Can't you do it on your php file and pass via variable to the template ?

Link to comment
Share on other sites

It seems. If you perform a search in .phtml files, you'll see a lot of examples like that:

{{$idField = $comment::$databaseColumnId;}}
{{$itemClassSafe = str_replace( '\\', '_', mb_substr( $comment::$itemClass, 4 ) );}}

One line for each php line.

Can't you do it on your php file and pass via variable to the template ?

Yeah, that's no big deal, it just seemed like an odd change to me. Thank you for your help :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...