当前位置: 首页>>代码示例>>PHP>>正文


PHP Html::getClass方法代码示例

本文整理汇总了PHP中Drupal\Component\Utility\Html::getClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::getClass方法的具体用法?PHP Html::getClass怎么用?PHP Html::getClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Component\Utility\Html的用法示例。


在下文中一共展示了Html::getClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildRegions

 /**
  * #pre_render callback for building the regions.
  */
 public function buildRegions(array $build)
 {
     $cacheability = CacheableMetadata::createFromRenderArray($build)->addCacheableDependency($this);
     $contexts = $this->getContexts();
     foreach ($this->getRegionAssignments() as $region => $blocks) {
         if (!$blocks) {
             continue;
         }
         $region_name = Html::getClass("block-region-{$region}");
         $build[$region]['#prefix'] = '<div class="' . $region_name . '">';
         $build[$region]['#suffix'] = '</div>';
         /** @var \Drupal\Core\Block\BlockPluginInterface[] $blocks */
         $weight = 0;
         foreach ($blocks as $block_id => $block) {
             if ($block instanceof ContextAwarePluginInterface) {
                 $this->contextHandler()->applyContextMapping($block, $contexts);
             }
             $access = $block->access($this->account, TRUE);
             $cacheability->addCacheableDependency($access);
             if (!$access->isAllowed()) {
                 continue;
             }
             $block_build = ['#theme' => 'block', '#attributes' => [], '#weight' => $weight++, '#configuration' => $block->getConfiguration(), '#plugin_id' => $block->getPluginId(), '#base_plugin_id' => $block->getBaseId(), '#derivative_plugin_id' => $block->getDerivativeId(), '#block_plugin' => $block, '#pre_render' => [[$this, 'buildBlock']], '#cache' => ['keys' => ['page_manager_block_display', $this->id(), 'block', $block_id], 'tags' => Cache::mergeTags($this->getCacheTags(), $block->getCacheTags()), 'contexts' => $block->getCacheContexts(), 'max-age' => $block->getCacheMaxAge()]];
             // Merge the cacheability metadata of blocks into the page. This helps
             // to avoid cache redirects if the blocks have more cache contexts than
             // the page, which the page must respect as well.
             $cacheability->addCacheableDependency($block);
             $build[$region][$block_id] = $block_build;
         }
     }
     $build['#title'] = $this->renderPageTitle($this->configuration['page_title']);
     $cacheability->applyTo($build);
     return $build;
 }
开发者ID:jeroenos,项目名称:jeroenos_d8.mypressonline.com,代码行数:37,代码来源:PageBlockDisplayVariant.php

示例2: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 36
     $context["classes"] = array(0 => "block", 1 => "block-" . \Drupal\Component\Utility\Html::getClass($this->getAttribute(isset($context["configuration"]) ? $context["configuration"] : null, "provider", array())));
     // line 41
     echo "<div";
     echo $this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "html", null, true);
     echo ">\n  ";
     // line 42
     echo $this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["title_prefix"]) ? $context["title_prefix"] : null, "html", null, true);
     echo "\n  ";
     // line 43
     if (isset($context["label"]) ? $context["label"] : null) {
         // line 44
         echo "    <h2";
         echo $this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["title_attributes"]) ? $context["title_attributes"] : null, "html", null, true);
         echo ">";
         echo $this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["label"]) ? $context["label"] : null, "html", null, true);
         echo "</h2>\n  ";
     }
     // line 46
     echo "  ";
     echo $this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["title_suffix"]) ? $context["title_suffix"] : null, "html", null, true);
     echo "\n  ";
     // line 47
     $this->displayBlock('content', $context, $blocks);
     // line 50
     echo "</div>\n";
 }
开发者ID:Nouveau,项目名称:gishtips,代码行数:29,代码来源:67bf0bc0986e484af050922aad5211ebb2fb1d26181590fa8daa45d70932742b.php

示例3: overview

 /**
  * Displays a listing of migration messages.
  *
  * Messages are truncated at 56 chars.
  *
  * @return array
  *   A render array as expected by drupal_render().
  */
 public function overview($migration_group, $migration)
 {
     $rows = [];
     $classes = static::getLogLevelClassMap();
     /** @var MigrationInterface $migration */
     $migration = Migration::load($migration);
     $source_id_field_names = array_keys($migration->getSourcePlugin()->getIds());
     $column_number = 1;
     foreach ($source_id_field_names as $source_id_field_name) {
         $header[] = ['data' => $source_id_field_name, 'field' => 'sourceid' . $column_number++, 'class' => [RESPONSIVE_PRIORITY_MEDIUM]];
     }
     $header[] = ['data' => $this->t('Severity level'), 'field' => 'level', 'class' => [RESPONSIVE_PRIORITY_LOW]];
     $header[] = ['data' => $this->t('Message'), 'field' => 'message'];
     $message_table = $migration->getIdMap()->messageTableName();
     $query = $this->database->select($message_table, 'm')->extend('\\Drupal\\Core\\Database\\Query\\PagerSelectExtender')->extend('\\Drupal\\Core\\Database\\Query\\TableSortExtender');
     $query->fields('m');
     $result = $query->limit(50)->orderByHeader($header)->execute();
     foreach ($result as $message_row) {
         $column_number = 1;
         foreach ($source_id_field_names as $source_id_field_name) {
             $column_name = 'sourceid' . $column_number++;
             $row[$column_name] = $message_row->{$column_name};
         }
         $row['level'] = $message_row->level;
         $row['message'] = $message_row->message;
         $row['class'] = [Html::getClass('migrate-message-' . $message_row->level), $classes[$message_row->level]];
         $rows[] = $row;
     }
     $build['message_table'] = ['#type' => 'table', '#header' => $header, '#rows' => $rows, '#attributes' => ['id' => $message_table, 'class' => [$message_table]], '#empty' => $this->t('No messages for this migration.')];
     $build['message_pager'] = ['#type' => 'pager'];
     return $build;
 }
开发者ID:sheldonrampton,项目名称:drupal8-drops,代码行数:40,代码来源:MessageController.php

示例4: doDisplay

    protected function doDisplay(array $context, array $blocks = array())
    {
        $tags = array("set" => 29, "if" => 37, "block" => 41);
        $filters = array("clean_class" => 31);
        $functions = array();

        try {
            $this->env->getExtension('sandbox')->checkSecurity(
                array('set', 'if', 'block'),
                array('clean_class'),
                array()
            );
        } catch (Twig_Sandbox_SecurityError $e) {
            $e->setTemplateFile($this->getTemplateName());

            if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
                $e->setTemplateLine($tags[$e->getTagName()]);
            } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
                $e->setTemplateLine($filters[$e->getFilterName()]);
            } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
                $e->setTemplateLine($functions[$e->getFunctionName()]);
            }

            throw $e;
        }

        // line 29
        $context["classes"] = array(0 => "block", 1 => ("block-" . \Drupal\Component\Utility\Html::getClass($this->getAttribute(        // line 31
(isset($context["configuration"]) ? $context["configuration"] : null), "provider", array()))), 2 => ("block-" . \Drupal\Component\Utility\Html::getClass(        // line 32
(isset($context["plugin_id"]) ? $context["plugin_id"] : null))));
        // line 35
        echo "<div";
        echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute((isset($context["attributes"]) ? $context["attributes"] : null), "addClass", array(0 => (isset($context["classes"]) ? $context["classes"] : null)), "method"), "html", null, true));
        echo ">
  ";
        // line 36
        echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, (isset($context["title_prefix"]) ? $context["title_prefix"] : null), "html", null, true));
        echo "
  ";
        // line 37
        if ((isset($context["label"]) ? $context["label"] : null)) {
            // line 38
            echo "    <h2";
            echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, (isset($context["title_attributes"]) ? $context["title_attributes"] : null), "html", null, true));
            echo ">";
            echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, (isset($context["label"]) ? $context["label"] : null), "html", null, true));
            echo "</h2>
  ";
        }
        // line 40
        echo "  ";
        echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, (isset($context["title_suffix"]) ? $context["title_suffix"] : null), "html", null, true));
        echo "
  ";
        // line 41
        $this->displayBlock('content', $context, $blocks);
        // line 44
        echo "</div>
";
    }
开发者ID:juanmnl07,项目名称:drupal8-test,代码行数:60,代码来源:4ad9772a326dada1bc74824d07cd16717c591bd611fbb9664c72d075882d2415.php

示例5: buildRegions

 /**
  * Build render arrays for each of the regions.
  *
  * @param array $regions
  *   The render array representing regions.
  * @param array $contexts
  *   The array of context objects.
  *
  * @return array
  *   An associative array, keyed by region ID, containing the render arrays
  *   representing the content of each region.
  */
 protected function buildRegions(array $regions, array $contexts)
 {
     $build = [];
     foreach ($regions as $region => $blocks) {
         if (!$blocks) {
             continue;
         }
         $region_name = Html::getClass("block-region-{$region}");
         $build[$region]['#prefix'] = '<div class="' . $region_name . '">';
         $build[$region]['#suffix'] = '</div>';
         /** @var \Drupal\Core\Block\BlockPluginInterface[] $blocks */
         $weight = 0;
         foreach ($blocks as $block_id => $block) {
             if ($block instanceof ContextAwarePluginInterface) {
                 $this->contextHandler->applyContextMapping($block, $contexts);
             }
             if ($block->access($this->account)) {
                 $block_render_array = ['#theme' => 'block', '#attributes' => [], '#weight' => $weight++, '#configuration' => $block->getConfiguration(), '#plugin_id' => $block->getPluginId(), '#base_plugin_id' => $block->getBaseId(), '#derivative_plugin_id' => $block->getDerivativeId()];
                 $block_render_array['content'] = $block->build();
                 $build[$region][$block_id] = $block_render_array;
             }
         }
     }
     return $build;
 }
开发者ID:populist,项目名称:drops-8,代码行数:37,代码来源:StandardDisplayBuilder.php

示例6: block_navbar

 public function block_navbar($context, array $blocks = array())
 {
     // line 67
     echo "    ";
     // line 68
     $context["navbar_classes"] = array(0 => "navbar", 1 => $this->getAttribute($this->getAttribute(isset($context["theme"]) ? $context["theme"] : null, "settings", array()), "navbar_inverse", array()) ? "navbar-inverse" : "navbar-default", 2 => $this->getAttribute($this->getAttribute(isset($context["theme"]) ? $context["theme"] : null, "settings", array()), "navbar_position", array()) ? "navbar-" . \Drupal\Component\Utility\Html::getClass($this->getAttribute($this->getAttribute(isset($context["theme"]) ? $context["theme"] : null, "settings", array()), "navbar_position", array())) : "container");
     // line 74
     echo "    <header";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["navbar_attributes"]) ? $context["navbar_attributes"] : null, "addClass", array(0 => isset($context["navbar_classes"]) ? $context["navbar_classes"] : null), "method"), "html", null, true));
     echo " id=\"navbar\" role=\"banner\"  style=\"border:none;background-color:white;margin-bottom:0px\"> \n      <div class=\"navbar-header\">\n        ";
     // line 76
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "navigation", array()), "html", null, true));
     echo "\n        ";
     // line 78
     echo "        <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">\n          <span class=\"sr-only\">";
     // line 79
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar(t("Toggle navigation")));
     echo "</span>\n          <span class=\"icon-bar\"></span>\n          <span class=\"icon-bar\"></span>\n          <span class=\"icon-bar\"></span>\n        </button>\n      </div>\n\n      ";
     // line 87
     echo "      ";
     if ($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "navigation_collapsible", array())) {
         // line 88
         echo "        <div class=\"navbar-collapse collapse\" style=\"padding-top: 80px;\">\n          ";
         // line 89
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "navigation_collapsible", array()), "html", null, true));
         echo "\n        </div>\n      ";
     }
     // line 92
     echo "    </header>\n  ";
 }
开发者ID:Suite5,项目名称:feelmybook,代码行数:30,代码来源:27fa654ec7d3bf34559bcda763f9fc0b73787bc6847caef8542b5736c9c00030.php

示例7: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 21
     $context["classes"] = array(0 => "views-ui-display-tab-bucket", 1 => isset($context["name"]) ? $context["name"] : null ? \Drupal\Component\Utility\Html::getClass(isset($context["name"]) ? $context["name"] : null) : "", 2 => isset($context["overridden"]) ? $context["overridden"] : null ? "overridden" : "");
     // line 27
     echo "<div";
     echo $this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "html", null, true);
     echo ">\n  ";
     // line 28
     if (isset($context["title"]) ? $context["title"] : null) {
         // line 29
         echo "<h3 class=\"views-ui-display-tab-bucket__title\">";
         echo $this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["title"]) ? $context["title"] : null, "html", null, true);
         echo "</h3>";
     }
     // line 31
     echo "  ";
     if (isset($context["actions"]) ? $context["actions"] : null) {
         // line 32
         echo $this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["actions"]) ? $context["actions"] : null, "html", null, true);
     }
     // line 34
     echo "  ";
     echo $this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["content"]) ? $context["content"] : null, "html", null, true);
     echo "\n</div>\n";
 }
开发者ID:Nouveau,项目名称:gishtips,代码行数:26,代码来源:537b616d5ca16306091c1bf8213d859e87ee856f47eacd1546f7465e0a4b26cf.php

示例8: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $__internal_7a0e19497cc5621f359001e57941961d5fa9198360c2e2b87d5e42aa5f916bf4 = $this->env->getExtension("native_profiler");
     $__internal_7a0e19497cc5621f359001e57941961d5fa9198360c2e2b87d5e42aa5f916bf4->enter($__internal_7a0e19497cc5621f359001e57941961d5fa9198360c2e2b87d5e42aa5f916bf4_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "core/themes/classy/templates/field/image.html.twig"));
     $tags = array("set" => 14);
     $filters = array("clean_class" => 15);
     $functions = array();
     try {
         $this->env->getExtension('sandbox')->checkSecurity(array('set'), array('clean_class'), array());
     } catch (Twig_Sandbox_SecurityError $e) {
         $e->setTemplateFile($this->getTemplateName());
         if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
             $e->setTemplateLine($tags[$e->getTagName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
             $e->setTemplateLine($filters[$e->getFilterName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
             $e->setTemplateLine($functions[$e->getFunctionName()]);
         }
         throw $e;
     }
     // line 14
     $context["classes"] = array(0 => isset($context["style_name"]) ? $context["style_name"] : null ? "image-style-" . \Drupal\Component\Utility\Html::getClass(isset($context["style_name"]) ? $context["style_name"] : null) : "");
     // line 18
     echo "<img";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "html", null, true));
     echo " />\n";
     $__internal_7a0e19497cc5621f359001e57941961d5fa9198360c2e2b87d5e42aa5f916bf4->leave($__internal_7a0e19497cc5621f359001e57941961d5fa9198360c2e2b87d5e42aa5f916bf4_prof);
 }
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:28,代码来源:6db174890ae97147665148ce20fa66fb5a8bb82f4279cf6e027c05fc00abbca0.php

示例9: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $tags = array("set" => 14);
     $filters = array("clean_class" => 15);
     $functions = array();
     try {
         $this->env->getExtension('sandbox')->checkSecurity(array('set'), array('clean_class'), array());
     } catch (Twig_Sandbox_SecurityError $e) {
         $e->setTemplateFile($this->getTemplateName());
         if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
             $e->setTemplateLine($tags[$e->getTagName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
             $e->setTemplateLine($filters[$e->getFilterName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
             $e->setTemplateLine($functions[$e->getFunctionName()]);
         }
         throw $e;
     }
     // line 14
     $context["classes"] = array(0 => isset($context["style_name"]) ? $context["style_name"] : null ? "image-style-" . \Drupal\Component\Utility\Html::getClass(isset($context["style_name"]) ? $context["style_name"] : null) : "");
     // line 18
     echo "<img";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "html", null, true));
     echo " />\n";
 }
开发者ID:OCIODOE,项目名称:drupal8,代码行数:25,代码来源:7cf2bc485debcd8df9d7e9d702b6064a3e67a5978bcdfff597ea32a4c868bc1d.php

示例10: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $tags = array("set" => 16, "if" => 21);
     $filters = array("clean_class" => 18);
     $functions = array();
     try {
         $this->env->getExtension('sandbox')->checkSecurity(array('set', 'if'), array('clean_class'), array());
     } catch (Twig_Sandbox_SecurityError $e) {
         $e->setTemplateFile($this->getTemplateName());
         if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
             $e->setTemplateLine($tags[$e->getTagName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
             $e->setTemplateLine($filters[$e->getFilterName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
             $e->setTemplateLine($functions[$e->getFunctionName()]);
         }
         throw $e;
     }
     // line 16
     $context["classes"] = array(0 => "region", 1 => "region-" . \Drupal\Component\Utility\Html::getClass(isset($context["region"]) ? $context["region"] : null));
     // line 21
     if (isset($context["content"]) ? $context["content"] : null) {
         // line 22
         echo "  <div";
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "html", null, true));
         echo ">\n    ";
         // line 23
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["content"]) ? $context["content"] : null, "html", null, true));
         echo "\n  </div>\n";
     }
 }
开发者ID:dev981,项目名称:gaptest,代码行数:31,代码来源:df71c08f4f88014f4469623cd9c16d3032f36246ed50cd2232f804fe070e3417.php

示例11: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $tags = array("set" => 27);
     $filters = array("clean_class" => 29, "raw" => 37, "safe_join" => 38, "t" => 46);
     $functions = array();
     try {
         $this->env->getExtension('sandbox')->checkSecurity(array('set'), array('clean_class', 'raw', 'safe_join', 't'), array());
     } catch (Twig_Sandbox_SecurityError $e) {
         $e->setTemplateFile($this->getTemplateName());
         if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
             $e->setTemplateLine($tags[$e->getTagName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
             $e->setTemplateLine($filters[$e->getFilterName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
             $e->setTemplateLine($functions[$e->getFunctionName()]);
         }
         throw $e;
     }
     // line 27
     $context["body_classes"] = array(0 => isset($context["logged_in"]) ? $context["logged_in"] : null ? "user-logged-in" : "", 1 => !(isset($context["root_path"]) ? $context["root_path"] : null) ? "path-frontpage" : "path-" . \Drupal\Component\Utility\Html::getClass(isset($context["root_path"]) ? $context["root_path"] : null), 2 => isset($context["node_type"]) ? $context["node_type"] : null ? "node--type-" . \Drupal\Component\Utility\Html::getClass(isset($context["node_type"]) ? $context["node_type"] : null) : "", 3 => isset($context["db_offline"]) ? $context["db_offline"] : null ? "db-offline" : "");
     // line 34
     echo "<!DOCTYPE html>\n<html";
     // line 35
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["html_attributes"]) ? $context["html_attributes"] : null, "html", null, true));
     echo ">\n  <head>\n    <head-placeholder token=\"";
     // line 37
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar(isset($context["placeholder_token"]) ? $context["placeholder_token"] : null));
     echo "\">\n    <title>";
     // line 38
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar($this->env->getExtension('drupal_core')->safeJoin($this->env, isset($context["head_title"]) ? $context["head_title"] : null, " | ")));
     echo "</title>\n    <css-placeholder token=\"";
     // line 39
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar(isset($context["placeholder_token"]) ? $context["placeholder_token"] : null));
     echo "\">\n    ";
     // line 41
     echo "    ";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar(isset($context["base_font"]) ? $context["base_font"] : null));
     echo "\n    <js-placeholder token=\"";
     // line 42
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar(isset($context["placeholder_token"]) ? $context["placeholder_token"] : null));
     echo "\">\n  </head>\n  <body";
     // line 44
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["body_classes"]) ? $context["body_classes"] : null), "method"), "html", null, true));
     echo ">\n    <a href=\"#main-content\" class=\"visually-hidden focusable skip-link\">\n      ";
     // line 46
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar(t("Skip to main content")));
     echo "\n    </a>\n    ";
     // line 48
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["page_top"]) ? $context["page_top"] : null, "html", null, true));
     echo "\n    ";
     // line 49
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["page"]) ? $context["page"] : null, "html", null, true));
     echo "\n    ";
     // line 50
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["page_bottom"]) ? $context["page_bottom"] : null, "html", null, true));
     echo "\n    <js-bottom-placeholder token=\"";
     // line 51
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar(isset($context["placeholder_token"]) ? $context["placeholder_token"] : null));
     echo "\">\n  </body>\n</html>\n";
 }
开发者ID:mu5a5hi,项目名称:testmampdrupal,代码行数:60,代码来源:0b2df560a773824b67e785a1ccbac724648110006c1dd3a1ac55e5270b9223cb.php

示例12: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $__internal_f5cce079f768131b8f1310979b4b92808ef545f69f67629e95d8c78e5adbbe0c = $this->env->getExtension("native_profiler");
     $__internal_f5cce079f768131b8f1310979b4b92808ef545f69f67629e95d8c78e5adbbe0c->enter($__internal_f5cce079f768131b8f1310979b4b92808ef545f69f67629e95d8c78e5adbbe0c_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "core/themes/classy/templates/layout/region.html.twig"));
     $tags = array("set" => 16, "if" => 21);
     $filters = array("clean_class" => 18);
     $functions = array();
     try {
         $this->env->getExtension('sandbox')->checkSecurity(array('set', 'if'), array('clean_class'), array());
     } catch (Twig_Sandbox_SecurityError $e) {
         $e->setTemplateFile($this->getTemplateName());
         if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
             $e->setTemplateLine($tags[$e->getTagName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
             $e->setTemplateLine($filters[$e->getFilterName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
             $e->setTemplateLine($functions[$e->getFunctionName()]);
         }
         throw $e;
     }
     // line 16
     $context["classes"] = array(0 => "region", 1 => "region-" . \Drupal\Component\Utility\Html::getClass(isset($context["region"]) ? $context["region"] : null));
     // line 21
     if (isset($context["content"]) ? $context["content"] : null) {
         // line 22
         echo "  <div";
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "html", null, true));
         echo ">\n    ";
         // line 23
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["content"]) ? $context["content"] : null, "html", null, true));
         echo "\n  </div>\n";
     }
     $__internal_f5cce079f768131b8f1310979b4b92808ef545f69f67629e95d8c78e5adbbe0c->leave($__internal_f5cce079f768131b8f1310979b4b92808ef545f69f67629e95d8c78e5adbbe0c_prof);
 }
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:34,代码来源:b7df3f631268427a30b1509c815a60619f9db9f20b6f1bb45fb7814f8c7be296.php

示例13: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $tags = array("set" => 38, "if" => 48, "block" => 58, "trans" => 63);
     $filters = array("clean_class" => 42, "clean_id" => 45, "without" => 46);
     $functions = array();
     try {
         $this->env->getExtension('sandbox')->checkSecurity(array('set', 'if', 'block', 'trans'), array('clean_class', 'clean_id', 'without'), array());
     } catch (Twig_Sandbox_SecurityError $e) {
         $e->setTemplateFile($this->getTemplateName());
         if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
             $e->setTemplateLine($tags[$e->getTagName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
             $e->setTemplateLine($filters[$e->getFilterName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
             $e->setTemplateLine($functions[$e->getFunctionName()]);
         }
         throw $e;
     }
     // line 38
     $context["classes"] = array(0 => "block", 1 => "block-menu", 2 => "navigation", 3 => "menu--" . \Drupal\Component\Utility\Html::getClass(isset($context["derivative_plugin_id"]) ? $context["derivative_plugin_id"] : null));
     // line 45
     $context["heading_id"] = $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "id", array()) . \Drupal\Component\Utility\Html::getId("-menu");
     // line 46
     echo "<nav role=\"navigation\" aria-labelledby=\"";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["heading_id"]) ? $context["heading_id"] : null, "html", null, true));
     echo "\"";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, twig_without($this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "role", "aria-labelledby"), "html", null, true));
     echo ">\n  ";
     // line 48
     echo "  ";
     if (!$this->getAttribute(isset($context["configuration"]) ? $context["configuration"] : null, "label_display", array())) {
         // line 49
         echo "    ";
         $context["title_attributes"] = $this->getAttribute(isset($context["title_attributes"]) ? $context["title_attributes"] : null, "addClass", array(0 => "visually-hidden"), "method");
         // line 50
         echo "  ";
     }
     // line 51
     echo "  ";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["title_prefix"]) ? $context["title_prefix"] : null, "html", null, true));
     echo "\n  <h2";
     // line 52
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["title_attributes"]) ? $context["title_attributes"] : null, "setAttribute", array(0 => "id", 1 => isset($context["heading_id"]) ? $context["heading_id"] : null), "method"), "html", null, true));
     echo ">";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["configuration"]) ? $context["configuration"] : null, "label", array()), "html", null, true));
     echo "</h2>\n  ";
     // line 53
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["title_suffix"]) ? $context["title_suffix"] : null, "html", null, true));
     echo "\n\n  ";
     // line 56
     echo "  ";
     $context["show_anchor"] = "show-" . \Drupal\Component\Utility\Html::getId($this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "id", array()));
     // line 57
     echo "  ";
     $context["hide_anchor"] = "hide-" . \Drupal\Component\Utility\Html::getId($this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "id", array()));
     // line 58
     echo "  ";
     $this->displayBlock('content', $context, $blocks);
 }
开发者ID:mu5a5hi,项目名称:testmampdrupal,代码行数:59,代码来源:f7d383545602eba8a5c51b386d4550d2155efc7f0ca259ec9e3ed7566027c296.php

示例14: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $tags = array("set" => 29, "if" => 44);
     $filters = array("clean_class" => 31, "t" => 53);
     $functions = array();
     try {
         $this->env->getExtension('sandbox')->checkSecurity(array('set', 'if'), array('clean_class', 't'), array());
     } catch (Twig_Sandbox_SecurityError $e) {
         $e->setTemplateFile($this->getTemplateName());
         if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
             $e->setTemplateLine($tags[$e->getTagName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
             $e->setTemplateLine($filters[$e->getFilterName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
             $e->setTemplateLine($functions[$e->getFunctionName()]);
         }
         throw $e;
     }
     // line 29
     $context["classes"] = array(0 => "field", 1 => "field--name-" . \Drupal\Component\Utility\Html::getClass(isset($context["field_name"]) ? $context["field_name"] : null), 2 => "field--type-" . \Drupal\Component\Utility\Html::getClass(isset($context["field_type"]) ? $context["field_type"] : null), 3 => "field--label-" . (isset($context["label_display"]) ? $context["label_display"] : null), 4 => "comment-wrapper");
     // line 38
     $context["title_classes"] = array(0 => "title", 1 => (isset($context["label_display"]) ? $context["label_display"] : null) == "visually_hidden" ? "visually-hidden" : "");
     // line 43
     echo "<section";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "html", null, true));
     echo ">\n  ";
     // line 44
     if ((isset($context["comments"]) ? $context["comments"] : null) && !(isset($context["label_hidden"]) ? $context["label_hidden"] : null)) {
         // line 45
         echo "    ";
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["title_prefix"]) ? $context["title_prefix"] : null, "html", null, true));
         echo "\n    <h2";
         // line 46
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["title_attributes"]) ? $context["title_attributes"] : null, "addClass", array(0 => isset($context["title_classes"]) ? $context["title_classes"] : null), "method"), "html", null, true));
         echo ">";
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["label"]) ? $context["label"] : null, "html", null, true));
         echo "</h2>\n    ";
         // line 47
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["title_suffix"]) ? $context["title_suffix"] : null, "html", null, true));
         echo "\n  ";
     }
     // line 49
     echo "\n  ";
     // line 50
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["comments"]) ? $context["comments"] : null, "html", null, true));
     echo "\n\n  ";
     // line 52
     if (isset($context["comment_form"]) ? $context["comment_form"] : null) {
         // line 53
         echo "    <h2 class=\"title comment-form__title\">";
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->renderVar(t("Add new comment")));
         echo "</h2>\n    ";
         // line 54
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["comment_form"]) ? $context["comment_form"] : null, "html", null, true));
         echo "\n  ";
     }
     // line 56
     echo "\n</section>\n";
 }
开发者ID:emilienGallet,项目名称:DrupalUnicef,代码行数:59,代码来源:36f04d0405663b362be8caab11bcc8e5a124f2e52ab823b71f370415e5df454a.php

示例15: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $tags = array("set" => 34, "if" => 52, "for" => 56);
     $filters = array("clean_class" => 34);
     $functions = array();
     try {
         $this->env->getExtension('sandbox')->checkSecurity(array('set', 'if', 'for'), array('clean_class'), array());
     } catch (Twig_Sandbox_SecurityError $e) {
         $e->setTemplateFile($this->getTemplateName());
         if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
             $e->setTemplateLine($tags[$e->getTagName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
             $e->setTemplateLine($filters[$e->getFilterName()]);
         } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
             $e->setTemplateLine($functions[$e->getFunctionName()]);
         }
         throw $e;
     }
     // line 34
     $context["field_name_class"] = \Drupal\Component\Utility\Html::getClass(isset($context["field_name"]) ? $context["field_name"] : null);
     // line 36
     $context["classes"] = array(0 => "field", 1 => "field-" . \Drupal\Component\Utility\Html::getClass(isset($context["entity_type"]) ? $context["entity_type"] : null) . "--" . (isset($context["field_name_class"]) ? $context["field_name_class"] : null), 2 => "field-name-" . (isset($context["field_name_class"]) ? $context["field_name_class"] : null), 3 => "field-type-" . \Drupal\Component\Utility\Html::getClass(isset($context["field_type"]) ? $context["field_type"] : null), 4 => "field-label-" . (isset($context["label_display"]) ? $context["label_display"] : null), 5 => (isset($context["label_display"]) ? $context["label_display"] : null) == "inline" ? "clearfix" : "");
     // line 46
     $context["title_classes"] = array(0 => "field__label", 1 => (isset($context["label_display"]) ? $context["label_display"] : null) == "visually_hidden" ? "visually-hidden" : "");
     // line 51
     echo "<div";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "html", null, true));
     echo ">\n  ";
     // line 52
     if (!(isset($context["label_hidden"]) ? $context["label_hidden"] : null)) {
         // line 53
         echo "    <h3";
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["title_attributes"]) ? $context["title_attributes"] : null, "addClass", array(0 => isset($context["title_classes"]) ? $context["title_classes"] : null), "method"), "html", null, true));
         echo ">";
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, isset($context["label"]) ? $context["label"] : null, "html", null, true));
         echo "</h3>\n  ";
     }
     // line 55
     echo "  <div";
     echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["content_attributes"]) ? $context["content_attributes"] : null, "addClass", array(0 => "field__items"), "method"), "html", null, true));
     echo ">\n    ";
     // line 56
     $context['_parent'] = $context;
     $context['_seq'] = twig_ensure_traversable(isset($context["items"]) ? $context["items"] : null);
     foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
         // line 57
         echo "      <div";
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute($this->getAttribute($context["item"], "attributes", array()), "addClass", array(0 => "field__item"), "method"), "html", null, true));
         echo ">";
         echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute($context["item"], "content", array()), "html", null, true));
         echo "</div>\n    ";
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 59
     echo "  </div>\n</div>\n";
 }
开发者ID:neetumorwani,项目名称:blogging,代码行数:58,代码来源:254a6da12b09ad063fd76440e746b89fa9bae5006108ef864102e4f123799223.php


注:本文中的Drupal\Component\Utility\Html::getClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。