Answer the question
In order to leave comments, you need to log in
How to get content between beginWidget and endWidget in widget code?
The Yii documentation has an example:
<?php $this->beginWidget('path.to.WidgetClass'); ?>
…некое содержимое, которое может быть использовано виджетом…
<?php $this->endWidget(); ?>
Answer the question
In order to leave comments, you need to log in
Widget class:
<?php
class MyWidget extends CWidget
{
public $prop1;
public $prop2;
public function run()
{
echo $this->prop1;
}
}
?>
<?php $this->beginWidget('myWidget', array('prop1'=>'value1','prop2'=>'value2' ))?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question