Pods::raw PHP 메소드

raw() 공개 메소드

Return the raw output for a field If you want the raw value for use in PHP for custom manipulation, you will want to use field() instead. This function will automatically convert arrays into a list of text such as "Rick, John, and Gary"
부터: 2.0
public raw ( string | array $name, boolean $single = null ) : string | null | false
$name string | array The field name, or an associative array of parameters
$single boolean (optional) For tableless fields, to return an array or the first
리턴 string | null | false The output from the field, null if the field doesn't exist, false if no value returned for tableless fields
    public function raw($name, $single = null)
    {
        $defaults = array('name' => $name, 'single' => $single, 'raw' => true);
        if (is_array($name) || is_object($name)) {
            $defaults['name'] = null;
            $params = (object) array_merge($defaults, (array) $name);
        } elseif (is_array($single) || is_object($single)) {
            $defaults['single'] = null;
            $params = (object) array_merge($defaults, (array) $single);
        } else {
            $params = (object) $defaults;
        }
        $value = $this->field($params);
        return $value;
    }