+ add a example for new model extension.

This commit is contained in:
wangchunsheng
2012-06-08 01:49:45 +00:00
parent cd0f77fca8
commit 9ba76ccac5
7 changed files with 36 additions and 0 deletions
+12
View File
@@ -71,4 +71,16 @@ class misc extends control
$this->view->browser = $browser;
$this->display();
}
/**
* Check model extension logic
*
* @access public
* @return void
*/
public function checkExtension()
{
echo $this->misc->hello();
echo $this->misc->hello2();
}
}
@@ -0,0 +1,8 @@
<?php
class testMisc extends miscModel
{
public function hello()
{
return parent::hello() . " from ext model<br />";
}
}
+6
View File
@@ -0,0 +1,6 @@
<?php
public function hello2()
{
echo $this->loadExtension('test')->hello(); // Load testMisc class from test.class.php in ext/model/class.
return $this->testMisc->hello(); // After loading, can use $this->testMisc to call it.
}
@@ -0,0 +1,2 @@
<?php
echo "start from hello.test.php <br>";
@@ -0,0 +1,2 @@
<?php
echo 'start from hellp.test2.php<br>';
@@ -0,0 +1,2 @@
<?php
echo 'start from hello2.start.php<br>';
+4
View File
@@ -13,4 +13,8 @@
<?php
class miscModel extends model
{
public function hello()
{
return 'hello world from hello()<br />';
}
}