I'm new to Yii, and i am struggling with the display of some classes. I have a very basic example:
I got my template file: themes/classic/views/layout/main.php and i want to call a class there.
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="box">
<h2>Categorieën</h2>
<p>
<?php
echo AdminController::producten(); //<--- this does not work!
?>
</p>
</div><!-- box -->
</div><!-- col-lg-2 -->
The class is protected/controllers/AdminController.php
In that class i have a function called producten()
public function producten(){
return 'Hier komen categorieën!';
}
I want to view that function (in this case a string) in my template page.
Can you guys show me how, if this is possible ofcourse. Or should i use a widget?