jeudi 17 décembre 2015

How get variables in other classes?

I want to access my variable $hello in my model.php file, how i do that ??

contollers/controller.php

class {

 public function hello() {

  $hello = "Hello world";

 }

}

model/model.php

class {

 public function helloworld() {

  echo $hello;

 }

}

I want to get the variable $hello...

Aucun commentaire:

Enregistrer un commentaire