當前位置: 首頁>>代碼示例>>PHP>>正文


PHP App::txts方法代碼示例

本文整理匯總了PHP中MapasCulturais\App::txts方法的典型用法代碼示例。如果您正苦於以下問題:PHP App::txts方法的具體用法?PHP App::txts怎麽用?PHP App::txts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MapasCulturais\App的用法示例。


在下文中一共展示了App::txts方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _outputArray

    protected function _outputArray(array $data, $singular_object_name = 'Entity', $plural_object_name = 'Entities')
    {
        $uriExplode = explode('/', $_SERVER['REQUEST_URI']);
        if ($data && key_exists(2, $uriExplode)) {
            $singular_object_name = mb_convert_encoding($this->translate[$uriExplode[2]], "HTML-ENTITIES", "UTF-8");
            $plural_object_name = $singular_object_name . 's';
        }
        ?>
        <!DOCTYPE html>
        <html>
            <head>
                <title><?php 
        echo sprintf(App::txts("%s {$singular_object_name} encontrado.", "%s {$plural_object_name} encontrados.", count($data)), count($data));
        ?>
</title>
                <meta charset="UTF-8">
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                <style>
                    table table th {text-align: left; white-space: nowrap; }
                </style>
            </head>
            <body>
                <h1><?php 
        echo sprintf(App::txts("%s {$singular_object_name} encontrado.", "%s {$plural_object_name} encontrados.", count($data)), count($data));
        ?>
</h1>
                <?php 
        $this->printTable($data);
        ?>
            </body>
        </html>
        <?php 
    }
開發者ID:wagnertw,項目名稱:mapasculturais,代碼行數:33,代碼來源:Html.php

示例2: _outputArray

    protected function _outputArray(array $data, $singular_object_name = 'Entity', $plural_object_name = 'Entities')
    {
        if (!key_exists('type', $data[0])) {
            die('@select entity type property is mandatory. Aborting');
        }
        $singular_object_name = $this->translate[$data[0]['type']->entity_class];
        $plural_object_name = $singular_object_name . 's';
        ?>
        <!DOCTYPE html>
        <html>
            <head>
                <title><?php 
        echo sprintf(App::txts("%s {$singular_object_name} encontrado.", "%s {$plural_object_name} encontrados.", count($data)), count($data));
        ?>
</title>
                <meta charset="UTF-8">
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                <style>
                    table table th {text-align: left; white-space: nowrap; }
                </style>
            </head>
            <body>
                <h1><?php 
        echo sprintf(App::txts("%s {$singular_object_name} encontrado.", "%s {$plural_object_name} encontrados.", count($data)), count($data));
        ?>
</h1>
                <?php 
        $this->printTable($data);
        ?>
            </body>
        </html>
        <?php 
    }
開發者ID:baldasso,項目名稱:mapasculturais,代碼行數:33,代碼來源:Html.php


注:本文中的MapasCulturais\App::txts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。