+ add a example for new model extension.
This commit is contained in:
@@ -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 />";
|
||||
}
|
||||
}
|
||||
@@ -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>';
|
||||
@@ -13,4 +13,8 @@
|
||||
<?php
|
||||
class miscModel extends model
|
||||
{
|
||||
public function hello()
|
||||
{
|
||||
return 'hello world from hello()<br />';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user