Returns a code snippet of a class, method or class member.
Name | Type | Description |
---|---|---|
of | string | A class, method, or a class member |
comment | bool | (Optional) True to also return the doc comment |
Source code:
<?php
class SomeClass
{
/**
* @param string $name
*/
public function sayHelloTo($name)
{
echo sprintf('Hello %s!', $name);
}
}
Documentation source:
{{ codeSnippet(of:'SomeClass::sayHelloTo', comment:true) }}
Result:
/**
* @param string $name
*/
public function sayHelloTo($name)
{
echo sprintf('Hello %s!', $name);
}