Defer to template.

@param course_competencies_page $page

@return string html for the page
178896
public function render_course_competencies_page(course_competencies_page $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('tool_lp/course_competencies_page', $data);
    }
923078
public function render_related_competencies_section(renderable $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('tool_lp/related_competencies', $data);
    }
300751
public function makeFullpath(Page $page)
    {
        if ($page->getParent() === NULL)
        {
            $page->setFullpath('');
            $page->setSlug('');
        }
        else
        {
            $parentFullpath = $page->getParent()->getFullpath();
            $slug = $this->addSuffixNumber($page->getSlug(), $page);
            $page->setFullpath(($parentFullpath != '' ? ($parentFullpath . '/') : '') . $slug);
            $page->setSlug($slug);
            if ($page->hasChildren())
            {
                foreach ($page->getChildren() as $children)
                {
                    $this->makeFullpath($children);
                    $this->doctrine->getManager()->persist($children);
                }
            }
        }
    }
1274235
public static function count_competencies_in_template_with_no_courses($templateorid) {
        // First we do a permissions check.
        $template = $templateorid;
        if (!is_object($template)) {
            $template = new template($template);
        }

        if (!$template->can_read()) {
            throw new required_capability_exception($template->get_context(), 'moodle/competency:templateview',
                'nopermissions', '');
        }

        // OK - all set.
        return template_competency::count_competencies_with_no_courses($template->get('id'));
    }
1198416
public function render_competencies_to_review_page(renderable $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('block_lp/competencies_to_review_page', $data);
    }
271167
public function setPage(Page $page)
    {
        $this->_page = $page;
        $page->setMainSection($this);

        return $this;
    }
157425
public function navigation($courseorid, $page) {
        $tabs = core_completion\manager::get_available_completion_tabs($courseorid);
        if (count($tabs) > 1) {
            return $this->tabtree($tabs, $page);
        } else {
            return '';
        }
    }
1056929
public function toTrash(Page $page)
    {
        $page->setState(Page::STATE_DELETED);

        if (!$page->isLeaf()) {
            $subquery = $this->getEntityManager()
                    ->getRepository('BackBee\NestedNode\Section')
                    ->createQueryBuilder('n')
                    ->select('n._uid')
                    ->andIsDescendantOf($page->getSection());

            $this->createQueryBuilder('p')
                            ->update()
                            ->set('p._state', Page::STATE_DELETED)
                            ->andWhere('p._section IN ('.$subquery->getDQL().')')
                            ->setParameters($subquery->getParameters())
                            ->getQuery()
                            ->execute();
        }

        return $page;
    }
545722
protected function getPagePriority(Page $page)
    {
        $result = '';
        $ak = $this->getSitemapPriorityAttributeKey();
        if ($ak !== null) {
            $result = (string) $page->getAttribute($ak);
        }
        if ($result === '') {
            $result = $this->getDefaultPriority();
        }

        return $result;
    }
1030458
private function get_link_html($page)
    {
        global $post;

        if (! empty($post) && $page->ID == $post->ID) {
            $li_class = $this->args['li_active_class'] . ' ' . $this->args['li_class'];
            $link_class = $this->args['link_active_class'] . ' ' . $this->args['link_class'];
        } else {
            $li_class = $this->args['li_class'];
            $link_class = $this->args['link_class'];
        }

        return \sprintf(
            '<li class="%s">%s<a class="%s" href="%s">%s%s%s</a>%s</li>',
            $li_class,
            $this->args['before_link'],
            $link_class,
            get_the_permalink($page),
            $this->args['before_text'],
            get_the_title($page),
            $this->args['after_text'],
            $this->args['after_link']
        );
    }
491473
public function render_manage_competency_frameworks_page(manage_competency_frameworks_page $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('tool_lp/manage_competency_frameworks_page', $data);
    }
149278
private function resolveScheme($scheme, Page $page)
    {
        $functions = explode('||', $scheme);
        $value = array_shift($functions);
        $content = $page->getContentSet();

        $matches = [];
        if (false !== preg_match_all(self::MATCH_PATTERN, $scheme, $matches, PREG_PATTERN_ORDER)) {
            $count = count($matches[0]);
            for ($i = 0; $i < $count; $i++) {
                $resolvedContent = $this->parseScheme($content, $matches[0][$i]);

                if ($resolvedContent instanceof AbstractClassContent && $resolvedContent->isElementContent()) {
                    $scheme = str_replace($matches[0][$i], $this->getElementValue($resolvedContent, $page), $scheme);
                } elseif (is_array($resolvedContent)) {
                    $scheme = str_replace($matches[0][$i], $this->getArrayValue($resolvedContent), $scheme);
                } else {
                    $resolvedContent = trim(str_replace(["\n", "\r"], '', strip_tags($resolvedContent)));
                    $scheme = str_replace($matches[0][$i], $resolvedContent, $scheme);
                }
            }
            $value = $scheme;
        }

        return $this->callback($value, $functions);
    }
287112
public static function data_for_course_competencies_page($courseid) {
        global $PAGE;
        $params = self::validate_parameters(self::data_for_course_competencies_page_parameters(), array(
            'courseid' => $courseid,
        ));
        self::validate_context(context_course::instance($params['courseid']));

        $renderable = new output\course_competencies_page($params['courseid']);
        $renderer = $PAGE->get_renderer('tool_lp');

        $data = $renderable->export_for_template($renderer);

        return $data;
    }
597549
public static function list_competencies_in_template($templateorid) {
        static::require_enabled();
        // First we do a permissions check.
        $template = $templateorid;
        if (!is_object($template)) {
            $template = new template($template);
        }

        if (!$template->can_read()) {
            throw new required_capability_exception($template->get_context(), 'moodle/competency:templateview',
                'nopermissions', '');
        }

        // OK - all set.
        return template_competency::list_competencies($template->get('id'));
    }
1332049
public function showAction(Page $page)
    {
        $deleteForm = $this->createDeleteForm($page);

        return array(
            'page' => $page,
            'delete_form' => $deleteForm->createView(),
        );
    }
463584
public static function search_competencies($searchtext, $competencyframeworkid) {
        global $PAGE;

        $params = self::validate_parameters(self::search_competencies_parameters(), array(
            'searchtext' => $searchtext,
            'competencyframeworkid' => $competencyframeworkid
        ));

        $framework = api::read_framework($params['competencyframeworkid']);
        $context = $framework->get_context();
        self::validate_context($context);
        $output = $PAGE->get_renderer('core');

        $results = api::search_competencies($params['searchtext'], $params['competencyframeworkid']);
        $records = array();
        foreach ($results as $result) {
            $exporter = new competency_exporter($result, array('context' => $context));
            $record = $exporter->export($output);

            array_push($records, $record);
        }

        return $records;
    }
756716
protected function createCreateForm(Page $page)
    {
        $channel = $this->getSelectedChannel();

        $form = $this->createForm(
            PageType::class,
            $page,
            [
                'action' => $this->generateUrl('integrated_page_page_new', ['channel' => $channel->getId()]),
                'method' => 'POST',
                'theme'  => $this->getTheme($channel),
            ]
        );

        $form->add('actions', SaveCancelType::class, [
            'cancel_route' => 'integrated_page_page_index',
            'cancel_route_parameters' => ['channel' => $this->getSelectedChannel()->getId()],
            'label' => 'Create',
            'button_class' => '',
        ]);

        return $form;
    }