PHP Classes

File: examples/example.php

Recommend this page to a friend!
  Classes of berkay karata?   PHP-DS   examples/example.php   Download  
File: examples/example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP-DS
Translate text in PHP code to different languages
Author: By
Last change:
Date: 6 years ago
Size: 1,378 bytes
 

Contents

Class file image Download
<?php
#CALL PHP_DS CLASS
$PHP_DS_LANGUAGE="EN";
include(
"../PHP-DS/PHP_DS.php");
#CREATE AN OBJECT FOR PHP_DS
$x = new PHP_DS_SUPPORTED("example-lang/EN.PHP");


//----------------------------------------------------------------------------------------------------
// Let's do our settings
//----------------------------------------------------------------------------------------------------
#Change Class Name
$x->class ="class_name";
#Key Type
$x->using="object";
#Function default indicator
$x->functions_d="A_Function";
#Variable default indicator
$x->variables_d="A_Variable";
//----------------------------------------------------------------------------------------------------
// Let's start creating our code :)
//----------------------------------------------------------------------------------------------------
$x->code='
class class_name
{
public $A_Variable1="its null";
public function A_Function1()
{
  echo $this->A_Variable1;
}
public function A_Function2()
{
  echo "Hello<br>";
}
}
'
;

//----------------------------------------------------------------------------------------------------
// And use our code
//----------------------------------------------------------------------------------------------------
$x->add();
$y = new example;
$y->presentation="I'm PHP-DS. I am a language pack for PHP classes.";
$y->say_hello();
$y->introduce_yourself();