Skip to content

How can i print content for each field using PHP? #533

@vanyabrovary

Description

@vanyabrovary

Question

How can i print content for each field using PHP?

There is my code:

// Get Entry
$enties = Entry::findOne(['id' => 1525, 'siteId' => 7])->contentBlocks->all();

// Get SuperTable block types
$stFields = Craft::$app->getFields()->getAllFields(
    'superTableBlockType:' .
    SuperTable::$plugin->getService()->getBlockTypesByFieldId($field->id)[0]->uid
);

// Print each SuperTable fielId and fieldHandle
foreach ($stFields as $stField) {
    print $stField->id . " " . $stField->handle  . "\n";
}

Thaks.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions