Builds the content view.

@param Model\ContentInterface $content

@return ContentView
342980
public function buildContent(Model\ContentInterface $content)
    {
        $view = new ContentView();
        $attributes = $view->getAttributes()->addClass('cms-content');

        if ($this->editor->isEnabled()) {
            $attributes
                ->setId('cms-content-' . $content->getId())
                ->setData([
                    'id'      => $content->getId(),
                    'actions' => [
                        // TODO
                    ],
                ]);
        }

        // Layout
        $this->editor->getLayoutAdapter()->buildContent($content, $view);

        foreach ($content->getContainers() as $container) {
            $view->containers[] = $this->buildContainer($container);
        }

        return $view;
    }
870022
public function setContent(string $content = null): ResponseContextAbstract
    {
        if (is_null($content)) {
            return $this;
        }

        $this->assertIsValid($content);

        $this->content = $content;

        return $this;
    }
86354
public function content($content)
    {
        if ($content instanceof Renderable) {
            $this->content = $content->render();
        } else {
            $this->content = (string) $content;
        }

        return $this;
    }
650669
static function ContentTreeUrl(Content $content)
    {
        $args = array();
        $pageContent = $content->GetPageContent();
        if ($pageContent)
        {
            $args['page'] = $pageContent->GetPage()->GetID();
            $args['area'] = $pageContent->GetArea()->GetID();
            return self::ModuleUrl(new \Phine\Bundles\Core\Modules\Backend\PageContentTree, $args);
        }
        $layoutContent = $content->GetLayoutContent();
        if ($layoutContent)
        {
            $args['area'] = $layoutContent->GetArea()->GetID();
            return self::ModuleUrl(new \Phine\Bundles\Core\Modules\Backend\LayoutContentTree, $args);
        }
        $containerContent = $content->GetContainerContent();
        if($containerContent)
        {
            $args['container'] = $containerContent->GetContainer()->GetID();
            return self::ModuleUrl(new \Phine\Bundles\Core\Modules\Backend\ContainerContentTree, $args);
        }
    }
937552
public function prepare(
        $content,
        ThemeInterface $theme,
        TemplateInterface $template,
        ZoneInterface $zone,
        ComponentInterface $component
    ) {
        $this->contextStack->push(
            $this->contextBuilder
                ->setContent($content)
                ->setTheme($theme)
                ->setTemplate($template)
                ->setZone($zone)
                ->setComponent($component)
            ->createContext()
        );

        return $this;
    }
701516
public function setContent(string $content, ?StreamFactoryInterface $streamFactory = null): WebResourceInterface
    {
        $response = null;
        $contentType = $this->contentType;

        if ($this->response && empty($streamFactory)) {
            throw UnwritableContentException::create();
        }

        if ($this->response) {
            $responseBody = $streamFactory->createFromString($content);
            $response = $this->response->withBody($responseBody);
            $contentType = null;
        }

        return $this->createNewInstance([
            WebResourceProperties::ARG_CONTENT_TYPE => $contentType,
            WebResourceProperties::ARG_CONTENT => $content,
            WebResourceProperties::ARG_RESPONSE => $response,
        ]);
    }
725716
protected function buildDomainUserGroupObject(APIContent $content)
    {
        $locationService = $this->repository->getLocationService();

        if ($content->getVersionInfo()->getContentInfo()->mainLocationId !== null) {
            $mainLocation = $locationService->loadLocation(
                $content->getVersionInfo()->getContentInfo()->mainLocationId
            );
            $parentLocation = $locationService->loadLocation($mainLocation->parentLocationId);
        }

        return new UserGroup(
            array(
                'content' => $content,
                'parentId' => isset($parentLocation) ? $parentLocation->contentId : null,
            )
        );
    }
247340
public function build($content)
    {
        $examples = $this->parser->extractExamples($content);

        for ($i = 0; $i < count($examples); $i++)
        {
            $examples[$i] =
                "## Example #".($i + 1)."\n\n".$this->buildBlock($examples[$i]);
        }

        return "# Examples\n\n".implode("\n", $examples);
    }
849742
public function html($content) {
        if (func_num_args() == 1) {
            $this->_data['fields'][] = $content;
            return $this;
        }
        $this->__attributes['fields'][$content] = func_get_arg(1);
        return $this;
    }
572966
protected function isContentOnSiteAllowed(ContentInterface $content)
    {
        $siteId = $this->contextManager->getSiteId();
        $site = $this->siteRepository->findOneBySiteId($siteId);

        return in_array($content->getContentType(), $site->getContentTypes());
    }
763364
public function getManyChildren(Content $content, QueryBuilder $builder)
    {
        return $this->getManyFrom($content->children()->newQuery()->getQuery(), $builder);
    }
576332
public function content($content = false)
    {
        if ($content === false) {
            return $this->adapter->fileGetContents($this->path);
        }

        $this->adapter->filePutContents($this->path, $content);
        return $this;
    }
642238
public function text($content = '')
    {
        $this->message = [
            'MsgType'      => 'text',
            'CreateTime'   => time(),
            'Content'      => $content,
            'ToUserName'   => $this->getOpenid(),
            'FromUserName' => $this->getToOpenid(),
        ];
        return $this;
    }
461158
public function renderAction(ComponentInterface $component, ContentInterface $content)
    {
        $menu = array();
        foreach ($component->getData('tree', array()) as $linkData) {
            // name / url required
            if (empty($linkData['name']) || empty($linkData['url'])) {
                continue;
            }
            $menu[$linkData['name']] = array(
                'url' => $linkData['url'],
                'children' => array(),
            );
        }

        return $this->get('synapse')
            ->createDecorator($component)
            ->decorate(array(
                'content' => $content,
                'menu' => $menu,
            ))
        ;
    }
431239
public function createCreateStructFromContent(Content $content)
    {
        $struct = new CreateStruct();
        $struct->name = $content->versionInfo->names;
        $struct->typeId = $content->versionInfo->contentInfo->contentTypeId;
        $struct->sectionId = $content->versionInfo->contentInfo->sectionId;
        $struct->ownerId = $content->versionInfo->contentInfo->ownerId;
        $struct->locations = array();
        $struct->alwaysAvailable = $content->versionInfo->contentInfo->alwaysAvailable;
        $struct->remoteId = md5(uniqid(get_class($this), true));
        $struct->initialLanguageId = $this->languageHandler->loadByLanguageCode($content->versionInfo->initialLanguageCode)->id;
        $struct->mainLanguageId = $this->languageHandler->loadByLanguageCode($content->versionInfo->contentInfo->mainLanguageCode)->id;
        $struct->modified = time();

        foreach ($content->fields as $field) {
            $newField = clone $field;
            $newField->id = null;
            $struct->fields[] = $newField;
        }

        return $struct;
    }
869055
public function displayContentField(ContentInterface $content = null, $slug)
    {
        if (null === $content) {
            return '';
        }
        foreach ($content->getFieldValues() as $fieldValue) {
            if ($fieldValue->getField()->getSlug() == $slug) {
                return $this->fieldManager->getFieldType($fieldValue->getField())->render($fieldValue);
            }
        }
        return '';
    }
72174
public function view($content, $title = null)
    {
        return $this->app[AdminController::class]->renderContent($content, $title);
    }