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


PHP Alert::info方法代码示例

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


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

示例1: test_chains_methods_to_build_complex_alert_messages

 function test_chains_methods_to_build_complex_alert_messages()
 {
     // Having
     $items = ['Laravel courses', 'OOP classes', 'Access to real projects', 'Support', 'And more'];
     Alert::info('Your account is about to expire')->details('A lot of knowledge still waits for you:')->items($items)->button('Renew now!', '#', 'primary')->button('Take me to your leader', 'http://google.com', 'info');
     // Expect
     $this->assertTemplate('alerts/complex', Alert::render());
 }
开发者ID:clemir,项目名称:html-integration-tests,代码行数:8,代码来源:AlertContainerTest.php

示例2: execute

 public function execute()
 {
     // Genereer een formulier waarmee je 2 environments kan kiezen.
     $environments = array('development', 'staging', 'production');
     $Form = new Form(array('method' => 'get'), array(new Fieldset('Compare environments', array('environments' => new FieldLabel('Environments', new Fields(array('source' => new SelectBox('source', $environments, [], new NotEmptyValidator()), 'target' => new SelectBox('target', $environments, [], new NotEmptyValidator()), new Input('submit', null, array('value' => 'Compare')))))))));
     $values = $Form->import($errors);
     if (!$values) {
         // Zijn er geen environments gekozen?
         return $Form;
     }
     $source = $values[0]['environments']['source'];
     $target = $values[0]['environments']['target'];
     $modules = Sledgehammer::getModules($this->paths['modules']);
     $constants_diff = [];
     /*
               // Loop door alle modules en vergelijk de constantes
               foreach($modules as $module) {
               $constants_ini = DEVHOOK_PATH.$module['folder'].'settings/constants.ini';
               if (!file_exists($constants_ini)) {
               continue;
               }
               $constants = parse_ini_file($constants_ini, true);
               $source_constants = isset($constants[$source]) ? $constants[$source] : [];
               $target_constants = isset($constants[$target]) ? $constants[$target] : [];
               $data = formatted_diff($source_constants, $target_constants);
               if (count($data) > 0) {
               foreach($data as $row) {
               $row['Module'] = $module['name'];
               $constants_diff[] = $row;
               }
               }
               } */
     // Vergelijk database instellingen
     $database_diff = [];
     $db_links_compared = [];
     $database_ini = $this->paths['project'] . 'app/database.ini';
     if (file_exists($database_ini)) {
         $database_settings = parse_ini_file($database_ini, true);
         foreach ($database_settings as $env_and_link => $settings) {
             $exploded_env_and_link = explode('.', $env_and_link);
             $environment = $exploded_env_and_link[0];
             $link = $exploded_env_and_link[1];
             if (in_array($link, $db_links_compared)) {
                 // Is deze link al gecontroleerd?
                 continue;
                 // door met de volgende link
             }
             $data = false;
             if ($environment == $source) {
                 // Is deze database setting voor de bron environment?
                 if (isset($database_settings[$target . '.' . $link])) {
                     // Is deze link ook voor de target environment geconfigureerd?
                     $target_settings = $database_settings[$target . '.' . $link];
                 } else {
                     $target_settings = [];
                     // Er zijn geen target settings
                 }
                 $data = formatted_diff($settings, $target_settings);
             } elseif ($environment == $target) {
                 if (isset($database_settings[$source . '.' . $link])) {
                     // Is deze link ook voor de target environment geconfigureerd?
                     $source_settings = $database_settings[$source . '.' . $link];
                 } else {
                     $source_settings = [];
                     // Er zijn geen target settings
                 }
                 $data = formatted_diff($source_settings, $settings);
             }
             if ($data) {
                 foreach ($data as $row) {
                     $row['Link'] = '[' . $link . ']';
                     $database_diff[] = $row;
                 }
                 $db_links_compared[] = $link;
             }
         }
     }
     $output = '';
     if (count($constants_diff) > 0) {
         $ConstantsDiff = new InteractiveTable(array('Module', 'setting', 'source', 'target'), '#');
         $ConstantsDiff->headers = array('setting' => 'Constant', 'source' => '[' . $source . ']', 'target' => '[' . $target . ']');
         $ConstantsDiff->Iterator = $constants_diff;
         $output .= '<h2>Constants.ini\'s</h2>' . view_to_string($ConstantsDiff);
     }
     if (count($database_diff) > 0) {
         $DatabaseDiff = new InteractiveTable(array('Link', 'setting', 'source', 'target'), '#');
         $DatabaseDiff->headers = array('setting' => 'Setting', 'source' => '[' . $source . ']', 'target' => '[' . $target . ']');
         $DatabaseDiff->Iterator = $database_diff;
         $output .= '<h2>Database.ini</h2>' . view_to_string($DatabaseDiff);
     }
     if ($output == '') {
         $output .= view_to_string(Alert::info('<h3>No differences found</h3>The environments are identical'));
     }
     return new Html(view_to_string($Form) . '<br />' . $output);
 }
开发者ID:sledgehammer,项目名称:core,代码行数:95,代码来源:CompareEnvironments.php


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