[Resolved] How to get the Block Field Definitions?

Hi All,

I tried to get field definitions of block type but it is retuning the layout definitions also. How to get only field definition for block ?

The code which i tried to get field definitions

$blockObject = $object->getBlockName();

Thanks, I found the answer and would like to share with you.

$ObjectFfieldDefintions = $object->getClass()->getFieldDefinitions();
$blockFieldDefinitions= $blockDefintion->getFieldDefinitions();

Don’t use getChilds() to get definitions unless if you need to get the layout definitions.

Karthikeyan Balusamy.

1 Like