Unfdefine变量:研讨会

时间:2016-05-31 11:50:35

标签: php

错误

  

注意:未定义的变量:C:\ wamp \ www \ MBL \ index.php上的研讨会   第273行

第273行

-(void)aMethod:(UIButton*)sender{
    [self.viewModel deleteAt:[sender tag]];
    [self.myCollectionView reloadData];
}

切断编码

$workshop .= '<div class="workshopAddon col-xs-4 text-center no-padding" style="display:none;">';

1 个答案:

答案 0 :(得分:3)

在向其追加字符串部分之前定义$workshop

</script>
    <!-- Server Workshop Collection -->
    <div class="col-xs-12" style="overflow:hidden;position:absolute!important;bottom:25px;">
        <?php
        include 'simple_html_dom.php';
        $url = 'http://steamcommunity.com/sharedfiles/filedetails/?&format=json&id=124102726';
        $html = file_get_html($url);
        $workshop = ''; // <!-------------------------------------------------- ADDED
        foreach($html->find('.collectionItem') as $element) {
            $workshop .= '<div class="workshopAddon col-xs-4 text-center no-padding" style="display:none;">';

            foreach($element->find('.workshopItemPreviewHolder') as $previewImg) {
                $img = '<div class="col-xs-3 no-padding text-center circular">'.$previewImg->innertext.'</div>';
            }

            foreach($element->find('.workshopItemTitle') as $displayName) {
                $title = '<p class="workshopItemTitle">'.$displayName->innertext.'</p>';
            }

            foreach($element->find('.workshopItemAuthor') as $displayName) {
                $author = '<p class="workshopItemAuthor">'.$displayName->innertext.'</p>';
            }


            $workshop .= $img.'
                <div class="col-xs-9 no-padding">
                '.$title.$author.'
                </div>
            </div>';
        }
        echo $workshop;
        ?>
        <script>