| sam 的个人资料>>> 這也將會過去 <<<照片日志列表 | 帮助 |
|
9月25日 mix-in ?<?php
//test.php
require_once(dirname(__FILE__) . '/Person.php');
//test
$thePerson = new Person("nobody");
$thePerson->say(" I am here!");
$thePerson->toSay(" Are you All Right!");
$thePerson->hello("I" , 'am', 'ok', '!');
?>
<?php
//Person.php
class Person {
private $name;
function __construct($name=null)
{
if($name) {
$this->name = $name;
}
}
function say($msg)
{
include(dirname(__FILE__) . '/module_say.php');
}
function statement($msg)
{
return include(dirname(__FILE__) . '/module_statement.php');
}
function toSay($msg)
{
echo($this->statement($msg));
}
function __call($name, $args)
{
$file = dirname(__FILE__) . '/module_' . $name . '.php';
if(file_exists($file)) {
return include($file);
}
}
} // class end
?>
<?php
//file:module_hello.php
//like some class block
//class someClass {
////like some function block
////function hello($I, $am, $ok, $end) {
////list($name,$args) = func_get_args(); //no need;Just show!
list($I, $am, $ok, $end) = $args;
$msg = sprintf("%s %s %s %s",
$I,
$am,
$ok,
$end
);
echo($this->statement($msg));
////} //end function
//} //end class
?>
<?php
//file:module_say.php
//like some class block
//class someClass {
////like some function block
////function say($msg) {
echo($this->name . ' say : [ ' . $msg . ' ] ' . "9月16日 Getting Started with Expression BlendGetting Started with Expression Blend http://www.contentpresenter.com/ http://www.microsoft.com/expression/kc/resources.aspx?type=tutorial http://blogs.msdn.com/karstenj http://windowsclient.net/Default.aspx
Cool WPF Tutorial Site
|
|
|