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


PHP Import::template方法代码示例

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


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

示例1: forgotPassword

 public function forgotPassword($email = "", $returnLinkPath = "")
 {
     if (!is_string($email)) {
         return Error::set(lang('Error', 'stringParameter', 'email'));
     }
     if (!is_string($returnLinkPath)) {
         $returnLinkPath = '';
     }
     // ------------------------------------------------------------------------------
     // CONFIG/USER.PHP AYARLARI
     // Config/User.php dosyasında belirtilmiş ayarlar alınıyor.
     // ------------------------------------------------------------------------------
     $userConfig = $this->config;
     $usernameColumn = $userConfig['usernameColumn'];
     $passwordColumn = $userConfig['passwordColumn'];
     $emailColumn = $userConfig['emailColumn'];
     $tableName = $userConfig['tableName'];
     // ------------------------------------------------------------------------------
     $db = uselib('DB');
     if (!empty($emailColumn)) {
         $db->where($emailColumn . ' =', $email);
     } else {
         $db->where($usernameColumn . ' =', $email);
     }
     $row = $db->get($tableName)->row();
     $result = "";
     if (isset($row->{$usernameColumn})) {
         if (!isUrl($returnLinkPath)) {
             $returnLinkPath = siteUrl($returnLinkPath);
         }
         $newPassword = Encode::create(10);
         $encodePassword = Encode::super($newPassword);
         $templateData = array('usernameColumn' => $row->{$usernameColumn}, 'newPassword' => $newPassword, 'returnLinkPath' => $returnLinkPath);
         $message = Import::template('UserEmail/ForgotPassword', $templateData, true);
         $sendEmail = uselib('Email');
         $sendEmail->receiver($email, $email);
         $sendEmail->subject(lang('User', 'newYourPassword'));
         $sendEmail->content($message);
         if ($sendEmail->send()) {
             if (!empty($emailColumn)) {
                 $db->where($emailColumn . ' =', $email);
             } else {
                 $db->where($usernameColumn . ' =', $email);
             }
             $db->update($tableName, array($passwordColumn => $encodePassword));
             $this->error = true;
             $this->success = lang('User', 'forgotPasswordSuccess');
             return false;
         } else {
             $this->success = false;
             $this->error = lang('User', 'emailError');
             return Error::set($this->error);
         }
     } else {
         $this->success = false;
         $this->error = lang('User', 'forgotPasswordError');
         return Error::set($this->error);
     }
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:59,代码来源:User.php

示例2: getTable

 public static function getTable($className = '', $methodName = '')
 {
     $data = array('errors' => self::$errors, 'className' => strtolower($className), 'methodName' => strtolower($methodName));
     return Import::template('ErrorTable', $data, true);
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:5,代码来源:Error.php

示例3: memory_get_usage

    //  System Elapsed Time Calculating
    //------------------------------------------------------------------------------------------------
    $elapsedTime = $finish - $start;
    //------------------------------------------------------------------------------------------------
    //------------------------------------------------------------------------------------------------
    //  Sistemin Bellek Kullanımını Hesapla
    //------------------------------------------------------------------------------------------------
    $memoryUsage = memory_get_usage();
    //------------------------------------------------------------------------------------------------
    //------------------------------------------------------------------------------------------------
    //  Sistemin Maksimum Bellek Kullanımını Hesapla
    //------------------------------------------------------------------------------------------------
    $maxMemoryUsage = memory_get_peak_usage();
    //------------------------------------------------------------------------------------------------
    //------------------------------------------------------------------------------------------------
    //  Benchmark Performans Sonuç Tablosu
    //------------------------------------------------------------------------------------------------
    $benchmarkData = array('elapsedTime' => $elapsedTime, 'memoryUsage' => $memoryUsage, 'maxMemoryUsage' => $maxMemoryUsage);
    $benchResult = Import::template('BenchmarkTable', $benchmarkData, true);
    //------------------------------------------------------------------------------------------------
    //------------------------------------------------------------------------------------------------
    //  Benchmark Performans Sonuç Tablosu Yazdırılıyor
    //------------------------------------------------------------------------------------------------
    echo $benchResult;
    //------------------------------------------------------------------------------------------------
    //------------------------------------------------------------------------------------------------
    //  Sistem benchmark performans test sonuçlarını raporla.
    //------------------------------------------------------------------------------------------------
    report('Benchmarking Test Result', $benchResult, 'BenchmarkTestResults');
    //------------------------------------------------------------------------------------------------
}
开发者ID:bytemtek,项目名称:znframework,代码行数:31,代码来源:index.php

示例4: run


//.........这里部分代码省略.........
         // Local Yerel Mod
         // Standart PHP hata çıktısı kapatılır. Bunun yerine
         // hatalar özel bir çıktı ile gösterilir.
         //------------------------------------------------------------------
         case 'local':
             //------------------------------------------------------------------
             // Development Geliştirme Modu
             // Tüm hatalar açıktır.
             //------------------------------------------------------------------
         //------------------------------------------------------------------
         // Development Geliştirme Modu
         // Tüm hatalar açıktır.
         //------------------------------------------------------------------
         case 'development':
             error_reporting(-1);
             break;
             //------------------------------------------------------------------
             //------------------------------------------------------------------
             // Farklı bir kullanım hatası
             //------------------------------------------------------------------
         //------------------------------------------------------------------
         //------------------------------------------------------------------
         // Farklı bir kullanım hatası
         //------------------------------------------------------------------
         default:
             echo 'Invalid Application Environment! Available Options: local, development or publication';
             exit;
             //------------------------------------------------------------------
     }
     //------------------------------------------------------------------
     /******************************************************************\
     		|                                                                  | 
     		|                SİSTEM BENCHMARK PERFORMANS TESTİ                 |
     		|                                                                  |
     		*******************************************************************/
     //------------------------------------------------------------------
     //------------------------------------------------------------------
     //------------------------------------------------------------------
     //------------------------------------------------------------------
     //  Sistem Performans Testini Başlat: true or false
     //------------------------------------------------------------------
     $BENCHMARK_PERFOMANCE_TEST_START = false;
     //------------------------------------------------------------------
     //------------------------------------------------------------------
     //------------------------------------------------------------------
     //------------------------------------------------------------------
     if ($BENCHMARK_PERFOMANCE_TEST_START === true) {
         //------------------------------------------------------------------
         //  Sisteminin Açılış Zamanını Hesaplamayı Başlat
         //------------------------------------------------------------------
         $start = microtime();
         //------------------------------------------------------------------
     }
     //******************************************************************
     //  Sistem yükleniyor ... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
     //
     require_once 'System/Core/Hierarchy.php';
     // <<<<<<<<<<<<<<<<<<<<<<<
     //
     //  Sistem çalıştırılıyor ... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
     //******************************************************************
     if ($BENCHMARK_PERFOMANCE_TEST_START === true) {
         //------------------------------------------------------------------
         //  Sistemin Açılış Zamanını Hesaplamayı Bitir
         //------------------------------------------------------------------
         $finish = microtime();
         //------------------------------------------------------------------
         //------------------------------------------------------------------
         //  System Elapsed Time Calculating
         //------------------------------------------------------------------
         $elapsedTime = $finish - $start;
         //------------------------------------------------------------------
         //------------------------------------------------------------------
         //  Sistemin Bellek Kullanımını Hesapla
         //------------------------------------------------------------------
         $memoryUsage = memory_get_usage();
         //------------------------------------------------------------------
         //------------------------------------------------------------------
         //  Sistemin Maksimum Bellek Kullanımını Hesapla
         //------------------------------------------------------------------
         $maxMemoryUsage = memory_get_peak_usage();
         //------------------------------------------------------------------
         //------------------------------------------------------------------
         //  Benchmark Performans Sonuç Tablosu
         //------------------------------------------------------------------
         $benchmarkData = array('elapsedTime' => $elapsedTime, 'memoryUsage' => $memoryUsage, 'maxMemoryUsage' => $maxMemoryUsage);
         $benchResult = Import::template('BenchmarkTable', $benchmarkData, true);
         //------------------------------------------------------------------
         //------------------------------------------------------------------
         //  Benchmark Performans Sonuç Tablosu Yazdırılıyor
         //------------------------------------------------------------------
         echo $benchResult;
         //------------------------------------------------------------------
         //------------------------------------------------------------------
         //  Sistem benchmark performans test sonuçlarını raporla.
         //------------------------------------------------------------------
         report('BenchmarkTestResults', $benchResult, 'BenchmarkTestResults');
         //------------------------------------------------------------------
     }
 }
开发者ID:erdidoqan,项目名称:znframework,代码行数:101,代码来源:index.php

示例5: internalBenchmarkReport

function internalBenchmarkReport($start, $finish)
{
    if (Config::get('Project', 'benchmark') === true && REQUEST_URI !== NULL) {
        //----------------------------------------------------------------------------------------------
        // System Elapsed Time Calculating
        //----------------------------------------------------------------------------------------------
        $elapsedTime = $finish - $start;
        //----------------------------------------------------------------------------------------------
        //----------------------------------------------------------------------------------------------
        // Get Memory Usage
        //----------------------------------------------------------------------------------------------
        $memoryUsage = memory_get_usage();
        //----------------------------------------------------------------------------------------------
        //----------------------------------------------------------------------------------------------
        // Get Maximum Memory Usage
        //----------------------------------------------------------------------------------------------
        $maxMemoryUsage = memory_get_peak_usage();
        //----------------------------------------------------------------------------------------------
        //----------------------------------------------------------------------------------------------
        // Template Benchmark Performance Result Table
        //----------------------------------------------------------------------------------------------
        $benchmarkData = ['elapsedTime' => $elapsedTime, 'memoryUsage' => $memoryUsage, 'maxMemoryUsage' => $maxMemoryUsage];
        $benchResult = Import::template('BenchmarkTable', $benchmarkData, true);
        //----------------------------------------------------------------------------------------------
        //----------------------------------------------------------------------------------------------
        // Get Benchmark Performance Result Table
        //----------------------------------------------------------------------------------------------
        echo $benchResult;
        report('Benchmarking Test Result', $benchResult, 'BenchmarkTestResults');
        //----------------------------------------------------------------------------------------------
    }
}
开发者ID:znframework,项目名称:znframework,代码行数:32,代码来源:Internal.php

示例6: _template

 private static function _template($msg, $file, $line)
 {
     $exceptionData = array('message' => $msg, 'file' => $file, 'line' => $line);
     return Import::template('ExceptionTable', $exceptionData, true);
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:5,代码来源:Exceptions.php


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