PhpStrom видимость переменных

Virt

Новичок
Здравствуйте.

Имеется следующая архитектура:
PHP:
<?
class Controller {

    public $modal;
    public $view;

    function __construct(){
        $this->view = new View("application/view");
    }

    function action_index($url){}

}

class Controller_Main extends Controller{

    function __construct(){
        parent::__construct();
    }

    function action_index($arr){
        $this->view->assign('v', new \lib\Order());
        $this->view->generate("main.php");
    }

}

class View {

    protected $tpl_path;
    protected static $vars;

    public function __construct($tpl_path) {
        $this->tpl_path = $tpl_path;
    }


    function generate($content_view = null, $template_view = null)
    {
        if(!empty(self::$vars))
            extract(self::$vars);

        if($template_view == null)
            $template_view = "template_view.php";

        include 'application/view/'.$template_view;
    }

    public function assign($var, $value) {
        self::$vars[$var] = $value;
    }

    public function render($template_file) {
        if(!empty(self::$vars))
            extract(self::$vars);
        include $this->tpl_path . '/' . $template_file;
    }

}

//template_view.php
<!DOCTYPE html>
<html>
<head>
    <meta content="text/html" charset="utf-8" />
    <script src="/js/jquery-2.0.3.min.js"></script>

    <link rel="stylesheet" href="/css/style.css">
    <title></title>
</head>
<body>

include __DIR__.'/'.$content_view;

</body>
</html>

//main.php
$v
Вся суть на скриншоте:
 
Последнее редактирование:

Virt

Новичок
Уточните, пожалуйсмта - есть много полей, как одним разом добавить для всех полей getter and setter
 

Virt

Новичок
Конечно можно воспользоваться и
PHP:
function __get($name)
{
return $this->$name;
}

function __set($name, $value) {
$this->$name = $value;
}
riff, оО
ctrl+enter -> getters and setters
Если быть точнее alt+enter и выбор.
НО данная процедура действий зависит от количество переменных
Данном ситуации, хочется воспользоваться одним действием для всех
 
Последнее редактирование:

Redjik

Джедай-мастер
alt+insert Getters and Setters - там можно через шитф или контрл выбрать несколько
 
  • Like
Реакции: Virt

Virt

Новичок
Сверху