Renders the page.

@param AnCommandContext $context
15172
protected function _actionRender(AnCommandContext $context)
    {
        if ($context->data instanceof Exception) {
            $this->getView()->content($context->data);
        } else {
            $this->getView()->content($context->response->getContent());
        }

        $content = $this->getView()->display();

        $context->response->setContent($content);
        $context->response->setContentType($this->getView()->mimetype);
    }
1100875
protected function _beforeControllerBrowse(AnCommandContext $context)
    {
        if (!$context->query) {
            $context->query = $this->_mixer->getRepository()->getQuery();
        }

        if ($this->hashtag) {
            $query = $context->query;
            $hashtags = array();
            $entityType = AnInflector::singularize($this->_mixer->getIdentifier()->name);
            $this->hashtag = (is_string($this->hashtag)) ? array($this->hashtag) : $this->hashtag;

            $edgeType = 'ComTagsDomainEntityTag,ComHashtagsDomainEntityTag,com:hashtags.domain.entity.tag';

            $query
            ->join('left', 'edges AS hashtag_edge', '('.$entityType.'.id = hashtag_edge.node_b_id AND hashtag_edge.type=\''.$edgeType.'\')')
            ->join('left', 'nodes AS hashtag', 'hashtag_edge.node_a_id = hashtag.id');

            foreach ($this->hashtag as $hashtag) {
                $hashtag = $this->getService('com:hashtags.filter.hashtag')->sanitize($hashtag);
                if ($hashtag != '') {
                    $hashtags[] = $hashtag;
                }
            }

            $query
            ->where('hashtag.name', 'IN', $hashtags)
            ->group($entityType.'.id');

            //print str_replace('#_', 'jos', $query);
        }
    }
753760
protected function _actionPrepclienv(AnCommandContext $context)
    {
        if (! empty($_SERVER['argv']) && count($_SERVER['argv']) > 1) {
            $args = array_slice($_SERVER['argv'], 1);

            if (is_readable(realpath($args[0]))) {
                $file = array_shift($args);
            }

            $args = explode('&-data&', implode($args, '&'));
            $args = array_filter($args, 'trim');

            foreach ($args as $i => $arg) {
                $arg = trim($arg);

                if ($i == 0) {
                    if (strpos($arg, '/') !== false) {
                        $arg = substr_replace($arg, '?', strpos($arg, '&'), 1);
                        $url = AnService::get('anahita:http.url', array('url' => $arg));
                        AnRequest::url()->path = AnRequest::base().$url->path;
                        $_GET = $url->query;
                    } else {
                        AnRequest::url()->path = AnRequest::base();
                        parse_str($arg, $_GET);
                    }
                } else {
                    parse_str($arg, $_POST);
                }
            }
        }

        $_GET['format'] = 'json';
        AnRequest::url()->format = 'json';
        AnRequest::url()->setQuery($_GET);

        AnService::get('com:plugins.helper')->import('cli');
        dispatch_plugin('cli.onCli');

        //if there's a file then just load the file and exit
        if (! empty($file)) {
            AnService::get('anahita:loader')->loadFile($file);
            exit(0);
        }
    }
1066667
protected function _actionAddcomment(AnCommandContext $context)
    {
        $data = $context->data;
        $comment = $this->getCommentController()->add(array('body' => $data->body));
        $context->response->status = AnHttpResponse::CREATED;
        $context->comment = $comment;

        if ($this->isDispatched()) {
            $context->response->content = $this->getCommentController()->display();

            if ($context->request->getFormat() == 'html') {
                $offset = $this->getItem()->getCommentOffset($comment->id);
                $start = (int) ($offset / $this->limit) * $this->limit;
                $context->response->setRedirect(route($comment->parent->getURL().'&start='.$start).'#scroll='.$comment->id);
            } else {
                $context->response->setRedirect(route($comment->getURL()));
            }
        }

        return $comment;
    }
986120
public function render($context = [])
    {
        $element = clone $this->element;

        $value = $this->element->getAttribute('value', false);
        if ($value !== false) {
            $this->element->getAttributes()->remove('value');
        }
        $html = parent::render($context);
        $this->element = $element;
        return $html;
    }
1132909
protected function _actionRoute(AnCommandContext $context)
    {
        //route the application
        $url = clone AnRequest::url();
        $url = $this->_application->getRouter()->parse($url);

        AnRequest::set('get', $url->query);

        $url->query = AnRequest::get('get', 'raw');

        //set the request
        $this->getRequest()->append($url->query);

        $component = substr($this->_request->option, 4);

        if (empty($component)) {
            $context->request->set('option', 'com_application');
            $component = 'application';
        }

        $this->setComponent($component)->dispatch();

        // trigger the onAfterRoute events
        dispatch_plugin('system.onAfterRoute');
    }
574314
protected function _actionRender(ViewContext $context)
    {
        $data = ObjectConfig::unbox($context->data);
        $path = $this->qualifyLayout($context->layout);

        //Render the template
        $content = $this->getTemplate()
            ->setParameters($context->parameters)
            ->render($path, $data);

        return $content;
    }
47843
def render_context(self, context, *args, **kwargs):
        
        if getattr(context, '_with_template', None) is None:
            context._set_with_template(self)
        runtime._render_context(self,
                                self.callable_,
                                context,
                                *args,
                                **kwargs)
178042
public function renderUserElementMap(array &$context)
	{
		$map = $this->renderer->getElementMap($context['user']['id'], Craft::$app->getSites()->getPrimarySite()->id);
		return $this->renderMap($map);
	}
811148
public function render($template, array $context = array())
    {
        $template = $this->twig->createTemplate($template);

        return $template->render($context);
    }
1256613
protected function _actionBrowse(AnCommandContext $context)
     {
         $entities = parent::_actionBrowse($context);

         if ($this->filter == 'leaders') {
             $ids = get_viewer()->leaderIds->toArray();
             $ids[] = get_viewer()->id;
             $entities->where('owner.id', 'IN', $ids);
         } else {
             $entities->owner($this->actor);
         }

         $entities->aggregateKeys($this->getService('com:stories.domain.aggregations'));
         
         $entities->order('creationTime', 'desc');

         if ($this->component) {
             $entities->clause()->component((array) AnConfig::unbox($this->component));
         }

         if ($this->name) {
             $entities->clause()->name((array) AnConfig::unbox($this->name));
         }

         if ($this->subject) {
             $entities->clause()->where('subject.id', 'IN', (array) AnConfig::unbox($this->subject));
         }

         return $this->setList($entities)->getList();
     }
777373
protected function _actionRender(TemplateContext $context)
    {
        $source = parent::render($context->source, ObjectConfig::unbox($context->data));

        if($context->type && !in_array($context->type, $this->_excluded_types))
        {
            $source = $this->getObject('template.engine.factory')
                ->createEngine($context->type, array('functions' => $this->getFunctions()))
                ->render($source, $this->getData());
        }

        return $source;
    }
167701
protected function _beforeRender(ControllerContext $context)
    {
        $controller = $context->getSubject();

        if (!$controller->isDispatched()) {
            $controller->loadLanguage();
        }
    }
1253367
public function render($context)
    {
        $column = $this->getRow()->getTable()->getParamAdapter()->getColumn();

        if (!$column && !$this->getDefaultColumn()) {
            return $context;
        } elseif (!$column && $this->getDefaultColumn()) {
            $column = $this->getDefaultColumn();
        }
        $actualRow = $this->getRow()->getActualRow();
        $valueOfColumn = $actualRow[$column];

        if ($this->getIsStarted()) {
            $this->setIsStarted(false);
            $this->setPreviousColumnValue($valueOfColumn);
            return $context;
        }

        if ($valueOfColumn !== $this->getPreviousColumnValue()
            && $this->getRow()->getTable()->getHeader($column)->getSeparatable()
        ) {
            $this->getRow()->addVarClass('separatable');
        }
        $this->setPreviousColumnValue($valueOfColumn);
    }
599387
public function render(Context $context) {
	    $context->pushTag($this);
		//================================================================
		//fig:macro
		//There is no condition to a macro definition.
		//A tag bearing the fig:macro directive is not implied mute.
		//It can render as a regular outer tag. If needed, it must be explicitly muted.
		if(null !== $this->figMacro) {
		    $result = $this->fig_macro($context);
		} else {
            $result = $this->renderNoMacro($context);

            // Clear transient flags
            $this->transientFlags = [];
        }
        $context->popTag();
		return $result;
	}
271481
public function setPageTitle(AnCommandContext $context)
    {
        $controller = $this->getController();

        if (! $controller->isIdentifiable()) {
            return;
        }

        $view = $controller->getView();
        $document = $this->getService('anahita:document');

        //@TODO temporary fix
        if ($document->getTitle()) {
            return;
        }

        $item = $controller->getState()->getItem();
        $actorbar = $controller->actorbar;

        $title = array();
        $description = null;

        if ($actorbar && $actorbar->getActor()) {
            if ($actorbar->getTitle()) {
                $title[] = $actorbar->getTitle();
            }

            $description = $actorbar->getDescription();
        } else {
            $title[] = ucfirst($view->getName());
        }

        if ($item && $item->isDescribable()) {
            array_unshift($title, $item->name);
            $description = $item->body;
        }

        $title = implode(' - ', array_filter(array_unique($title)));

        $document->setTitle($title);
        $document->setDescription($description);

        if ($item) {
            $document->setLink(route($item->getURL()));
            if ($item->isPortraitable()) {
                $document->setImage($item->getPortraitURL('large'));
            } else if ($item->isCoverable()) {
                $document->setImage($item->getCoverURL('large'));
            }

            if ($item instanceof ComActorsDomainEntityActor) {
                $document->setType('profile');
            }

            if ($item instanceof ComMediumDomainEntityMedium) {
                $document->setType('article');
            }
        }
    }
1058344
public function redirect(AnCommandContext $context)
    {
        if ($context->action === 'edit' || $context->action === 'add') {
            $context->response->setRedirect(route($this->getItem()->getURL().'&layout=edit'));
        } else {
            return parent::redirect($context);
        }
    }