0.0.1 • Published 6 years ago

example-class-php v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

##PHP CLASS MODEL

ExampleModel.php

<?php
namespace App\Model;
/**
 * 
 */
class ExampleModel/* extends AnotherClass*/
{
	
	function __construct($value='')
	{
		$this->param=$value;
	}
	public function callfunction($obj='',$pr)
	{
		echo $obj->param;
		$obj->exampleFunction($pr);
	}
	public function exampleFunction($val)
	{
		echo $val;
	}
	public static function Create($param1='',$param2='')
	{
		$Object = new static($param1);
		$Object->callfunction($Object,$param2);
		return $Object;
	}
}

?>

CallModel.php

<?php
namespace App\CallFolder;
use App\CallFolder\AnotherClass;
use App\Model\ExampleModel;
/**
 * 
 */
class CallModel extends AnotherClass
{
	
	function Call()
	{
		$Obj=ExampleModel::Create('This is param1'.PHP_EOL, 'This is param2');
		var_dump($Obj);
		return $Obj;
	}
}
?>
0.0.1

6 years ago