doCallback example

foreach ($this->SingleToArray as $toAddr) {
                $mail = @popen($sendmail, 'w');
                if (!$mail) {
                    throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
                }
                $this->edebug("To: {$toAddr}");
                fwrite($mail, 'To: ' . $toAddr . "\n");
                fwrite($mail$header);
                fwrite($mail$body);
                $result = pclose($mail);
                $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet);
                $this->doCallback(
                    ($result === 0),
                    [[$addrinfo['address']$addrinfo['name']]],
                    $this->cc,
                    $this->bcc,
                    $this->Subject,
                    $body,
                    $this->From,
                    []
                );
                $this->edebug("Result: " . ($result === 0 ? 'true' : 'false'));
                if (0 !== $result) {
                    

  protected function doRender(&$elements$is_root_call = FALSE) {
    if (empty($elements)) {
      return '';
    }

    if ($this->rendererConfig['debug'] === TRUE) {
      $render_start = microtime(TRUE);
    }

    if (!isset($elements['#access']) && isset($elements['#access_callback'])) {
      $elements['#access'] = $this->doCallback('#access_callback', $elements['#access_callback'][$elements]);
    }

    // Early-return nothing if user does not have access.     if (isset($elements['#access'])) {
      // If #access is an AccessResultInterface object, we must apply its       // cacheability metadata to the render array.       if ($elements['#access'] instanceof AccessResultInterface) {
        $this->addCacheableDependency($elements$elements['#access']);
        if (!$elements['#access']->isAllowed()) {
          // Abort, but bubble new cache metadata from the access result.           $context = $this->getCurrentRenderContext();
          
Home | Imprint | This part of the site doesn't use cookies.