Render a checkbox element.

@param   array $data The data to create a checkbox with.
@param   \Cake\View\Form\ContextInterface $context The current form context.
@return  string Generated HTML string.
760537
public function render(array $data, ContextInterface $context)
    {
        $data += ['class' => ''];
        $data['class'] .= ' filled-in ';
        $data['class'] = trim($data['class']);

        return parent::render($data, $context);
    }
1365565
public function validate(ExecutionContextInterface $context)
    {
        $template = $this;
        while ($template != null) {
            if ($template->getLayout() != null) {
                return;
            }
            $template = $template->getTemplate();
        }

        if ($this->getLayout() == null) {
            $context->buildViolation('data.template.templateform.view.type.template.layout.validator_message')->addViolation();
        }
    }
633048
public function renderEntryElementMap(array &$context)
	{
		$map = $this->renderer->getElementMap($context['entry']['id'], $context['site']['id']);
		return $this->renderMap($map);
	}
866476
protected function _renderInputs($data, $context)
    {
        $out = [];
        foreach ($data['options'] as $key => $val) {
            // Grouped inputs in a fieldset.
            if (is_string($key) && is_array($val) && !isset($val['text'], $val['value'])) {
                $inputs = $this->_renderInputs(['options' => $val] + $data, $context);
                $title = $this->_templates->format('multicheckboxTitle', ['text' => $key]);
                $out[] = $this->_templates->format('multicheckboxWrapper', [
                    'content' => $title . implode('', $inputs)
                ]);
                continue;
            }

            // Standard inputs.
            $checkbox = [
                'value' => $key,
                'text' => $val,
            ];
            if (is_array($val) && isset($val['text'], $val['value'])) {
                $checkbox = $val;
            }
            if (!isset($checkbox['templateVars'])) {
                $checkbox['templateVars'] = $data['templateVars'];
            }
            if (!isset($checkbox['label'])) {
                $checkbox['label'] = $data['label'];
            }
            if (!empty($data['templateVars'])) {
                $checkbox['templateVars'] = array_merge($data['templateVars'], $checkbox['templateVars']);
            }
            $checkbox['name'] = $data['name'];
            $checkbox['escape'] = $data['escape'];
            $checkbox['checked'] = $this->_isSelected($checkbox['value'], $data['val']);
            $checkbox['disabled'] = $this->_isDisabled($checkbox['value'], $data['disabled']);
            if (empty($checkbox['id'])) {
                $checkbox['id'] = $this->_id($checkbox['name'], $checkbox['value']);
            }
            $out[] = $this->_renderInput($checkbox + $data, $context);
        }

        return $out;
    }
918322
private function render($templateString, array $data)
    {
        $snippetRenderer = \TPkgSnippetRenderer::GetNewInstance(
            $templateString,
            \IPkgSnippetRenderer::SOURCE_TYPE_STRING
        );
        foreach ($data as $key => $value) {
            $snippetRenderer->setVar($key, $value);
        }

        return trim($snippetRenderer->render());
    }
1205527
public function render($context = [])
    {
        if ($this->getElement()->hasAttribute('value')) {
            $this->getElement()->getAttributes()->remove('value');
        }
        return parent::render($context);
    }
1117559
public function render(Context $context)
    {
        $result = '';
        foreach ($this->children as $child) {
            $result .= $child->render($context);
        }
        return $result;
    }
373419
public function render($context)
    {
        if (count($this->class) > 0 && is_array($this->class)) {
            foreach ($this->class as $class) {
                $this->getCell()->addClass($class);
            }
        }
        return $context;
    }
468535
public function renderContext($contextUid)
    {
        $endpoint = vsprintf('contexts/%s/render', $contextUid);
        $requestData = $this->getDefaultRequestData('form_params', []);

        return $this->sendRequest($endpoint, $requestData, self::HTTP_METHOD_POST);
    }
558135
public function render($context)
    {
        $values = array();

        foreach ($this->vars as $var) {
            $actualRow = $this->getRow()->getActualRow();
            $values[] = $actualRow[$var];
        }
        $value = vsprintf($this->value, $values);

        $this->getRow()->addVarAttr($this->name, $value);
        return $context;
    }
184514
public function validate($data, array $rules, $context = null): ValidatorInterface
    {
        return new Validator($data, $rules, $context, $this);
    }
703305
public function validate($context = 'default', array $data = [])
    {
        if (!empty($data)) {
            $this->setData($data);
        }

        $this->setContext($context);
        $rules = $this->buildRulesArray();
        $validator = $this->factory->make($this->filterArray($rules, $this->data), $rules);
        if ($validator->passes()) {
            return $validator->getData();
        }
        throw new ValidationException($validator);
    }
414037
public function render($context = [])
    {
        $this->setAttribute('value', $this->getInstanceValue());
        $data = parent::render($context);
        if ($this->isMultiple()) {
            $this->updateInstance();
        }
        return $data;
    }
1233288
public function render(string $template, array $data = []): string
    {
        // we store the current state of the template variables
        // so that we have isolated cases on multiple calls to render()
        $backupVariables = $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlVariables;

        if (!empty($data)) {
            $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlVariables = $data;
        }

        try {
            ob_start();

            /** @noinspection PhpIncludeInspection */
            require $template;
        } finally {
            $output = ob_get_clean();
        }

        $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlVariables = $backupVariables;

        return $output;
    }
1319293
public function RenderData($Data = NULL) {
      if ($Data === NULL) {
         $Data = array();

         // Remove standard and "protected" data from the top level.
         foreach ($this->Data as $Key => $Value) {
            if ($Key && in_array($Key, array('Title', 'Breadcrumbs')))
               continue;
            if (isset($Key[0]) && $Key[0] === '_')
               continue; // protected
            
            $Data[$Key] = $Value;
         }
         unset($this->Data);
      }

      // Massage the data for better rendering.
      foreach ($Data as $Key => $Value) {
         if (is_a($Value, 'Gdn_DataSet')) {
            $Data[$Key] = $Value->ResultArray();
         }
      }
      
      $CleanOutut = C('Api.Clean', TRUE);
      if ($CleanOutut) {
         // Remove values that should not be transmitted via api
         $Remove = array('Password', 'HashMethod', 'TransientKey', 'Permissions', 'Attributes', 'AccessToken');
         if (!Gdn::Session()->CheckPermission('Garden.Moderation.Manage')) {
            $Remove[] = 'InsertIPAddress';
            $Remove[] = 'UpdateIPAddress';
            $Remove[] = 'LastIPAddress';
            $Remove[] = 'AllIPAddresses';
            $Remove[] = 'Fingerprint';
            if (C('Api.Clean.Email', TRUE))
               $Remove[] = 'Email';
            $Remove[] = 'DateOfBirth';
         }
         $Data = RemoveKeysFromNestedArray($Data, $Remove);
      }
      
      // Make sure the database connection is closed before exiting.
      $this->EventArguments['Data'] = &$Data;
      $this->Finalize();
      
      // Add error information from the form.
      if (isset($this->Form) && sizeof($this->Form->ValidationResults())) {
         $this->StatusCode(400);
         $Data['Code'] = 400;
         $Data['Exception'] = Gdn_Validation::ResultsAsText($this->Form->ValidationResults());
      }
      
      
      $this->SendHeaders();

      // Check for a special view.
      $ViewLocation = $this->FetchViewLocation(($this->View ? $this->View : $this->RequestMethod).'_'.strtolower($this->DeliveryMethod()), FALSE, FALSE, FALSE);
      if (file_exists($ViewLocation)) {
         include $ViewLocation;
         return;
      }
      
      // Add schemes to to urls.
      $r = array_walk_recursive($Data, array('Gdn_Controller', '_FixUrlScheme'), Gdn::Request()->Scheme());
      
      switch ($this->DeliveryMethod()) {
         case DELIVERY_METHOD_XML:
            header('Content-Type: text/xml', TRUE);
            echo '<?xml version="1.0" encoding="utf-8"?>'."\n";
            $this->_RenderXml($Data);
            return TRUE;
            break;
         case DELIVERY_METHOD_PLAIN:
            return TRUE;
            break;
         case DELIVERY_METHOD_JSON:
         default:
            if (($Callback = $this->Request->Get('callback', FALSE)) && $this->AllowJSONP()) {
               header('Content-Type: application/javascript', TRUE);
               // This is a jsonp request.
               echo $Callback.'('.json_encode($Data).');';
               return TRUE;
            } else {
               header('Content-Type: application/json', TRUE);
               // This is a regular json request.
               echo json_encode($Data);
               return TRUE;
            }
            break;
      }
      return FALSE;
   }
777293
public function render($context)
    {
        return (isset($this->options[$context])) ? $this->options[$context] :    $context;
    }
372073
protected static function render_array_of_elements ($selector, $data) {
		$output = '';
		foreach ($data as $d) {
			$output .= static::__callStatic($selector, $d);
		}
		return $output;
	}