How to use the locutus/php/strings.addcslashes function in locutus

To help you get started, we’ve selected a few locutus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NightlyCommit / twing / src / lib / compiler.ts View on Github external
string(value: string): TwingCompiler {
        if (!isNullOrUndefined(value)) {
            if (typeof value === 'string') {
                value = '`' + addcslashes(value, "\0\t\\`").replace(/\${/g, '\\${') + '`';
            }
        }
        else {
            value = '``';
        }

        this.source += value;

        return this;
    }