Skip to content

Attribute ScriptName

Piotr edited this page Dec 5, 2013 · 2 revisions

Targets: Class, Method, Field, Property; AllowMultiple: false

ScriptNameAttribute is used to decorate classes or methods with an alternate name optionally including namespace that should be presented in PHP code.

Example 1: Change method name

[ScriptName("myHeader")]
public static void Header(string title)
{
...
}

will be translated to

public static function myHeader($title) {
...
}

Example 2: Change class name with namespace

[ScriptName(@"\MyNamespace\MyClassName")]
public class OriginalName

will be translated to

namespace MyNamespace
class MyClassName {

Clone this wiki locally