##PHP 5.4新特性##
掌握
-
traits
trait的引入,可以扩展class的内容,使class在某种形式上实现了多重继承,更加灵活,trait不能被实例化 示例代码:<?php
trait Hello {
| <?php | |
| final class stdtpl_main | |
| { | |
| const P_NAME_MAIN = 'main'; | |
| const P_NAME_ZK = 'zk'; | |
| const P_NAME_SERVER = 'server'; | |
| private static $iTimeWaitForServerPreHeat; | |
| private static $iTimeWaitForServerCoolDown; |
| <?php | |
| namespace QMTV\System; | |
| /** | |
| * Class FileCache | |
| * | |
| * @author liuzhen | |
| */ | |
| class FileCache | |
| { |
##PHP 5.4新特性##
掌握
traits
trait的引入,可以扩展class的内容,使class在某种形式上实现了多重继承,更加灵活,trait不能被实例化
示例代码:
<?php
trait Hello {
| <!DOCTYPE html> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
| <meta name="keywords" content="管理后台"> | |
| <meta name="description" content="管理后台"/> | |
| <title>GA管理后台</title> | |
| <style type="text/css"> | |
| html,body { |
| #!/usr/bin/env python | |
| # -*- coding: UTF-8 -*- | |
| from email.mime.multipart import MIMEMultipart | |
| from email.mime.base import MIMEBase | |
| from email.mime.text import MIMEText | |
| # python 2.3.*: email.Utils email.Encoders | |
| from email.utils import COMMASPACE, formatdate | |
| from email import encoders |