Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 Yii 框架的新手,我需要定义一个从 /protected/views/layouts/main.php 页面调用的函数。我可以知道要定义它(控制器/模型),以便我可以获得函数中定义的相应动作。
根据功能的作用以及您需要它的可见程度,您可以执行至少两件事之一:
$this->myFunction();
$this->myModelObject->myFunction();