Welcome Guest, Not a member yet? Register   Sign In
Page will not display with an array (using treeview)
#1

[eluser]JanDoToDo[/eluser]
Hi guys,

I have four sections in my treeview. When I display the page with the first 3 sections it works. When i add the 4th section it breaks and doesnt even error, it just goes straight to "page cannot be displayed". Ive never seen this behaviour before so would like some help.

I load the data from MySQL for each of the four sections:
Code:
$x['ref_categories'] = $this -> references -> get_resources('category', array('category_for' => 'reference', 'active' => 1), $language_id, 'order');
            if ( ! empty($x['ref_categories'])) :
                foreach($x['ref_categories'] as $id => $ref):
                    $x['ref_categories'][$id]['url'] = 'references/categories/' . $ref['url_key'];
                    // Get products that relate to this category
                    $refs = $this -> references -> get_reference_list($ref['category_id'], $this -> default_language, FALSE, FALSE, 'categories');
                    foreach ($refs as $ref) :
                        $ref['url'] = 'references/details/' . $ref['url_key'];
                        $x['ref_categories'][$id]['new_references'][] = $ref;
                    endforeach;
                endforeach;
            endif;
            
            $x['ref_parameters'] = $this -> references -> get_resources('parameter', FALSE, $language_id, 'parameter_title');
            if ( ! empty($x['ref_parameters'])) :
                foreach($x['ref_parameters'] as $id => $ref):
                    $x['ref_parameters'][$id]['url'] = 'references/parameters/' . $ref['url_key'];
                    // Get references that relate to this parameter
                    $refs = $this -> references -> get_reference_list($ref['parameter_id'], $this -> default_language, FALSE, FALSE, 'parameters');
                    foreach ($refs as $ref) :
                        $ref['url'] = 'references/details/' . $ref['url_key'];
                        $x['ref_parameters'][$id]['new_references'][] = $ref;
                    endforeach;
                endforeach;
            endif;
            
            $x['prod_categories'] = $this -> products -> get_resources('category', array('category_for' => 'product', 'active' => 1), $language_id, 'order');
            if ( ! empty($x['prod_categories'])) :
                foreach($x['prod_categories'] as $id => $ref):
                    $x['prod_categories'][$id]['url'] = 'products/categories/' . $ref['url_key'];
                    // Get products that relate to this category
                    $prods = $this -> products -> get_product_list($ref['category_id'], $this -> default_language, FALSE, FALSE, 'categories');
                    foreach ($prods as $prod) :
                        $prod['url'] = 'products/details/' . $prod['url_key'];
                        $x['prod_categories'][$id]['products'][] = $prod;
                    endforeach;
                endforeach;
            endif;
            
            $x['prod_parameters'] = $this -> products -> get_resources('parameter', FALSE, $language_id, 'parameter_title');
            if ( ! empty($x['prod_parameters'])) :
                foreach($x['prod_parameters'] as $id => $ref):
                    $x['prod_parameters'][$id]['url'] = 'products/parameters/' . $ref['url_key'];
                    // Get products that relate to this parameter
                    $prods = $this -> products -> get_product_list($ref['parameter_id'], $this -> default_language, FALSE, FALSE, 'parameters');
                    foreach ($prods as $prod) :
                        $prod['url'] = 'products/details/' . $prod['url_key'];
                        $x['prod_parameters'][$id]['products'][] = $prod;
                    endforeach;
                endforeach;
            endif;

And then i call the view and load this view page which is echoed back to the controller to a variable:
#2

[eluser]JanDoToDo[/eluser]
Code:
<? $class = ($site_cat == 'references') ? '' : 'closed'; ?>
    <li class="&lt;?=$class?&gt;">
        <span class="folder">
            &lt;? $style = "text-decoration:none; color:#000;"; ?&gt;
            &lt;?=anchor('references/index', lang('references'), array('style' => $style))?&gt;
        </span>
        <ul>
            &lt;? $class = ($site_sect == 'categories') ? '' : 'closed'; ?&gt;
            <li class="&lt;?=$class?&gt;">
                <span class="folder">
                    &lt;?=anchor('references/categories', lang('categories'), array('style' => $style))?&gt;
                </span>
                &lt;? if (isset($ref_categories) && ! empty($ref_categories)) : ?&gt;
                    <ul>
                        &lt;? foreach ($ref_categories as $category) : ?&gt;
                            &lt;? $class = ($site_item == $category['url_key']) ? '' : 'closed'; ?&gt;
                            <li class="&lt;?=$class?&gt;">
                                <span class="folder">
                                    &lt;?=anchor($category['url'], $category['category_title'], array('style' => $style));?&gt;
                                </span>
                                &lt;? if (isset($category['new_references']) && ! empty($category['new_references'])) : ?&gt;
                                    <ul>
                                        &lt;? foreach ($category['new_references'] as $reference) : ?&gt;
                                            <li>
                                                <span class="file">
                                                    &lt;?=anchor($reference['url'], $reference['title'], array('style' => $style));?&gt;
                                                </span>
                                            </li>
                                        &lt;? endforeach; ?&gt;
                                    </ul>
                                &lt;? endif; ?&gt;
                            </li>    
                        &lt;? endforeach; ?&gt;
                    </ul>
                &lt;? endif; ?&gt;
            </li>
            &lt;? $class = ($site_sect == 'parameters' || $site_sect == 'details') ? '' : 'closed'; ?&gt;
            <li class="&lt;?=$class?&gt;">
                <span class="folder closed">
                    &lt;?=anchor('references/parameters',lang('parameters'), array('style' => $style))?&gt;
                </span>
                &lt;? if (isset($ref_parameters) && ! empty($ref_parameters)) : ?&gt;
                    <ul>
                        &lt;? foreach ($ref_parameters as $parameter) : ?&gt;
                            &lt;? $class = ($site_item == $parameter['url_key']) ? '' : 'closed'; ?&gt;
                            <li class="&lt;?=$class?&gt;">
                                <span class="folder">
                                    &lt;?=anchor($parameter['url'], $parameter['parameter_title'], array('style' => $style));?&gt;
                                </span>
                                &lt;? if (isset($parameter['new_references']) && ! empty($parameter['new_references'])) : ?&gt;
                                    <ul>
                                        &lt;? foreach ($parameter['new_references'] as $reference) : ?&gt;
                                            <li>
                                                <span class="file">
                                                    &lt;?=anchor($reference['url'], $reference['title'], array('style' => $style));?&gt;
                                                </span>
                                            </li>
                                        &lt;? endforeach; ?&gt;
                                    </ul>
                                &lt;? endif; ?&gt;
                            </li>    
                        &lt;? endforeach; ?&gt;
                    </ul>
                &lt;? endif; ?&gt;
            </li>
        </ul>
    </li>
#3

[eluser]JanDoToDo[/eluser]
Code:
&lt;? $class = ($site_cat == 'products') ? '' : 'closed'; ?&gt;
    <li class="&lt;?=$class?&gt;">
        <span class="folder">
            &lt;? $style = "text-decoration:none; color:#000;"; ?&gt;
            &lt;?=anchor('products/index', lang('products'), array('style' => $style))?&gt;
        </span>
        <ul>
            &lt;? $class = ($site_sect == 'categories') ? '' : 'closed'; ?&gt;
            <li class="&lt;?=$class?&gt;">
                <span class="folder">
                    &lt;?=anchor('products/categories', lang('categories'), array('style' => $style))?&gt;
                </span>
                &lt;? if (isset($prod_categories) && ! empty($prod_categories)) : ?&gt;
                    <ul>
                        &lt;? foreach ($prod_categories as $category) : ?&gt;
                            &lt;? $class = ($site_item == $category['url_key']) ? '' : 'closed'; ?&gt;
                            <li class="&lt;?=$class?&gt;">
                                <span class="folder">
                                    &lt;?=anchor($category['url'], $category['category_title'], array('style' => $style));?&gt;
                                </span>
                                &lt;? if (isset($category['products']) && ! empty($category['products'])) : ?&gt;
                                    <ul>
                                        &lt;? foreach ($category['products'] as $product) : ?&gt;
                                            <li>
                                                <span class="file">
                                                    &lt;?=anchor($product['url'], $product['title'], array('style' => $style));?&gt;
                                                </span>
                                            </li>
                                        &lt;? endforeach; ?&gt;
                                    </ul>
                                &lt;? endif; ?&gt;
                            </li>    
                        &lt;? endforeach; ?&gt;
                    </ul>
                &lt;? endif; ?&gt;
            </li>
            
            &lt;? $class = ($site_sect == 'parameters' || $site_sect == 'details') ? '' : 'closed'; ?&gt;
            <li class="&lt;?=$class?&gt;">
                <span class="folder closed">
                    &lt;?=anchor('products/parameters',lang('parameters'), array('style' => $style))?&gt;
                </span>
                &lt;? if (isset($prod_parameters) && ! empty($prod_parameters)) : ?&gt;
                    <ul>
                        &lt;? foreach ($prod_parameters as $ref_param) : ?&gt;
                            &lt;? $class = ($site_item == $ref_param['url_key']) ? '' : 'closed'; ?&gt;
                            <li class="&lt;?=$class?&gt;">
                                <span class="folder">
                                    &lt;?=anchor($ref_param['url'], $ref_param['parameter_title'], array('style' => $style));?&gt;
                                </span>
                                &lt;?  if (isset($ref_param['products']) && ! empty($ref_param['products'])) : ?&gt;
                                    <ul>
                                        &lt;? foreach ($ref_param['products'] as $prod_product) : ?&gt;
                                            <li>
                                                <span class="file">
                                                    &lt;? /*anchor($prod_product['url'], $prod_product['title'], array('style' => $style))*/;?&gt;
                                                </span>
                                            </li>
                                        &lt;? endforeach; ?&gt;
                                    </ul>
                                &lt;? endif; ?&gt;
                            </li>    
                        &lt;? endforeach; ?&gt;
                    </ul>
                &lt;? endif; ?&gt;
            </li>
        </ul>
    </li>
#4

[eluser]JanDoToDo[/eluser]
And the problem is (as you can see i have commented out the line in the post directly above) if i uncomment this line, the page goes straight to "page cannot be displayed" and if i leave it commented out, the page loads fine.

So i thought maybe it is to do with the data in the array, but it is populated in exactly the same way as the others and i can vardump it in the controller and the data is fine. Is there a max limit to a page size or something? What would cause it to jump to "page cannot be displayed" instead of some kind of error message??
#5

[eluser]JanDoToDo[/eluser]
Come on guys - Someone have ANY ideas!!?? Please!




Theme © iAndrew 2016 - Forum software by © MyBB