LightnCandy\Runtime::p PHP Method

p() public static method

For {{> partial}} .
public static p ( array\arraystring | integer> $cx, string $p, arraystring | integer> | integer | null $v, $pid, $sp = '' ) : string
$cx array\arraystring | integer>
$p string partial name
$v arraystring | integer> | integer | null
return string The rendered string of the partial
    public static function p($cx, $p, $v, $pid, $sp = '')
    {
        if ($p === '@partial-block') {
            $p = "{$p}" . ($pid > 0 ? $pid : $cx['partialid']);
        }
        if (!isset($cx['partials'][$p])) {
            static::err($cx, "Can not find partial named as '{$p}' !!");
            return '';
        }
        $cx['partialid'] = $pid;
        return call_user_func($cx['partials'][$p], $cx, static::m($cx, $v[0][0], $v[1]), $sp);
    }