Example #1
0
 public function run()
 {
     //$targetArray = TagsAlgo::getTagResult();
     $tagObj = new TagsAlgo();
     $targetArray = $tagObj->getTagResult();
     echo $this->render('TagCloud', ['idName' => $this->idName, 'targetArray' => json_encode($targetArray)]);
 }
                    </div>
                    <div class="modal-footer">
                        <button class="btn default" data-dismiss="modal">ยกเลิก</button>
                        <button id="document-modal-confirm" data-dismiss="modal" class="btn blue">ยืนยัน</button>
                    </div>
                </div>
            </div>
        </div>
        
</div>

<script>

function recalltagdoc(){
    <?php 
$tagObj = new TagsAlgo();
$targetArray = $tagObj->getTagResult();
$targetArray = json_encode($targetArray);
?>
    $("#tag_doc").select2({
        tags: <?php 
echo $targetArray;
?>
,
    });         
}  

jQuery(document).ready(function() { 
	
    // initiate layout and plugins
    <?php