PHP Mail方法链接

时间:2017-10-15 11:39:22

标签: php

我正在进行链接练习,并且在链接方法时不会显示mail方法。我在这里错过了什么吗?

@echo off
    setlocal enableextensions disabledelayedexpansion

    rem Flag variable. Assume current folder is not present in path variable 
    set "present="

    rem This code uses:
    rem  Q: Pretty print %path%       https://stackoverflow.com/q/5471556
    rem     A:  Jeb answer            https://stackoverflow.com/a/5472168
    rem     A:  dbenham enhancement   https://stackoverflow.com/a/7940444
    set "var=%path:"=""%"
    set "var=%var:^=^^%"
    set "var=%var:&=^&%"
    set "var=%var:|=^|%"
    set "var=%var:<=^<%"
    set "var=%var:>=^>%"
    set "var=%var:;=^;^;%"
    set var=%var:""="%
    set "var=%var:"=""Q%"
    set "var=%var:;;="S"S%"
    set "var=%var:^;^;=;%"
    set "var=%var:""="%"
    setlocal EnableDelayedExpansion
    set "var=!var:"Q=!"

    rem Get a reference to current folder (%%c) and check against each 
    rem delimited value inside the processed variable
    for %%c in (.) do for %%a in ("!var:"S"S=";"!") do (
        if "!!"=="" endlocal
        if %%a neq "" for %%b in ("%%~fa.") do (
            if /i "%%~fb"=="%%~fc" set "present=1"
        )
    )

    if defined present (
        echo Current folder is INCLUDED in path variable
    ) else (
        echo Current folder is NOT included in path variable
    )

2 个答案:

答案 0 :(得分:1)

您正return mail()中的文字echo $user1->sayHello()->register()->mail();

您可以在调用方法时回显它:

$result = $user1->sayHello()->register()->mail();
// do some work
echo "The result is: ".$result;

Demo

通过这种方式,您可以将结果保存到变量中,例如,稍后再使用:

public function mail(){
    echo 'Emailed';
}

或者在方法本身中回应它:

swal({
      title: 'Hello',
      target: ".myClass"
        });

Demo

答案 1 :(得分:0)

您将从mail方法返回值,而不是回显它。尝试

webpack-dev-server