, Eloquent " " ( , f.type) , Twig "" .
Twig:
foo.bar PHP:
- ,
foo - , bar - ; - ,
foo , , bar ; - ,
foo - , , bar ( bar - __construct()); - ,
foo - , , getBar ; - ,
foo - , , isBar ; - , .
foo['bar'], , PHP:
- , : ", ". , PHP Twig isset $f->type. Eloquent __isset Model, , .
, __isset :
public function __isset($key)
{
return (isset($this->attributes[$key]) || isset($this->relations[$key])) ||
($this->hasGetMutator($key) && ! is_null($this->getAttributeValue($key)));
}
, "" (isset($this->relations[$key])). , type , Eloquent , "".
, Twig $f->type, , type :
... foo , , bar
type(), . ? type() () Relation ( , a BelongsTo), type. BelongsTo .
, Twig , $f->type , :
type Field, @roger-collins, ;__isset Field:
public function __isset($name)
{
if (in_array($name, [
'type'
])) {
return true;
} else {
return parent::__isset($name);
}
}
Twig , type Field, , .