5.6 Accessing a single page controller from another single page controller

Permalink
I have 2 single pages with the following locations

controllers/mypage/controller.php
class MyController extends Controller { }

controllers/yourpage/controller.php
class YourpageController extends Controller { }

single_pages/mypage/view.php
single_pages/yourpage/view.php

I want to call a function under mypage/controller.php say my_list() from within yourpage/controller.php How do I go about that

Thanks

wavemedia
 
wavemedia replied on at Permalink Reply
wavemedia
Found my solution. Ill leave answer here in case someone looks for same answer

in the view.php page where i want to use the function from another single page controller use

from within yourpage/view.php i adde the lines to the top of my page

$st = Loader::controller('/mypage');

$st->my_list();