Answer the question
In order to leave comments, you need to log in
How to call one method to another?
Guys, tell me, I don’t know where to look anymore. I need a method inside a class to be able to work inside another method. I simplified the example for understanding. Writes that the function is not declared.
class myPage
{
private function hellow_world()
{
return 'hellow_world';
}
public function createPage()
{
return hellow_world();
}
}
$page = new myPage();
echo $page->createPage();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question