D
D
Dmitry Cherednichenko2014-07-13 20:40:01
Kohana
Dmitry Cherednichenko, 2014-07-13 20:40:01

How to display a variable from the parent (Kohana) in a child controller?

There is a Common controller

abstract class Controller_Common extends Controller_Template {

and Controller Products
class Controller_Products extends Controller_Common {

How do I declare a $xxx variable in Common and output it to Products?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Lesnykh, 2014-07-14
@Aliance

And what are the difficulties?

abstract class Controller_Common extends Controller_Template {
    protected $_xxx = 'ololo';
}

class Controller_Products extends Controller_Common {
    public function __construct() {
        die('унаследованная переменная: ' . $this->_xxx);
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question