Reputation: 13
I am new to Yii framework and i need to define a function which is being called from /protected/views/layouts/main.php page. can i knw were to define it(Controller/model), so that i can get the corresponding action defined within the function.
Upvotes: 1
Views: 6277
Reputation: 8218
Depending on what the function does and how visible you need it to be, you can do one of at least two things:
$this->myFunction();
) $this->myModelObject->myFunction();
.Upvotes: 3