Welcome Guest, Not a member yet? Register   Sign In
not loading view[SOLVED]
#1

[eluser]diasansley[/eluser]
The below is my controller. The problem is that it doesnt load the view. It only loads the second <div> in the view file i have pasted.

Code:
$brands = $this->m_brand_to_entry->getAllBrandsForEntry($id);
        $this->content['content'] .= $this->_renderFrontendOutput('brands/_front_entry_brands_list.php',array('brands'=>$brands));



view file

Code:
<div class="entry_brand_container">
    &lt;?php
        if(!empty($brands))
        {
    ?&gt;
    <div class="entry_brand_row_header">Marken</div>
    <div class="entry_brand_colum1">
    &lt;?php
          $counter = 1;  
          foreach($brands as $brand):
    ?&gt;
                
  
    &lt;?php
            if(!empty($brand['name']))
            {
    ?&gt;
  
                &lt;?=anchor('entries/showAllEntries/brand/'.$brand['brand_id'], $brand['name'], array('class' => 'marken_row'));?&gt;
            
    &lt;?php
                $counter++;
            }
          endforeach;
        }
    ?&gt;
</div>
</div>
<p class="entry_all_links_container">
&lt;?=anchor('brands/showAllBrands', 'alle Marken', array('id'=>'all_brands_link','class' => 'entry_all_link'));?&gt;
<img  src="&lt;?=base_url();?&gt;img/shared/frontend_down_arrow.jpg" alt="partition image" />
</p>


thanks
#2

[eluser]takasia[/eluser]
When there is no data ($brands is empty -> just pasted the view without the controller) it just shows me this source:

<div class="entry_brand_container">
</div>
</div>
<p class="entry_all_links_container">
<a href="/brands/showAllBrands" id="all_brands_link" class="entry_all_link">
alle Marken</a>
<img src="/img/shared/frontend_down_arrow.jpg" alt="partition image" />
</p>

There is one </div> too much, maybe your browser doesn't like it? ;-)
#3

[eluser]diasansley[/eluser]
i cant figure out what your sayin.. I find all the divs proper.

Please have a look again

Thanks
#4

[eluser]LuckyFella73[/eluser]
Takasia is right. You have to move the last closing DIV tag inside
the if(!empty($brands)) condition.

Code:
<div class="entry_brand_container">
    &lt;?php
        if(!empty($brands))
        {
    ?&gt;
    <div class="entry_brand_row_header">Marken</div>
    <div class="entry_brand_colum1">
    &lt;?php
          $counter = 1;  
          foreach($brands as $brand):
    ?&gt;
                
  
    &lt;?php
            if(!empty($brand['name']))
            {
    ?&gt;
  
                &lt;?=anchor('entries/showAllEntries/brand/'.$brand['brand_id'], $brand['name'], array('class' => 'marken_row'));?&gt;
            
    &lt;?php
                $counter++;
            }
          endforeach;
          echo '</div>';
        }
    ?&gt;
</div>
<p class="entry_all_links_container">
&lt;?=anchor('brands/showAllBrands', 'alle Marken', array('id'=>'all_brands_link','class' => 'entry_all_link'));?&gt;
<img  src="&lt;?=base_url();?&gt;img/shared/frontend_down_arrow.jpg" alt="partition image" />
</p>
#5

[eluser]diasansley[/eluser]
ok tried but still it displays only the last part ...

not the upper div.

Please help.
Thanks
#6

[eluser]diasansley[/eluser]
Can someone please have a look here..

I need it to display.


Thanks
#7

[eluser]takasia[/eluser]
Can you paste all the source of what is displaying?

No the php, just the source code from the browser, the result of what php is doing. (Ctrl+U in Firefox, copy and paste here)
#8

[eluser]diasansley[/eluser]
here is the source:
Also i need to mention this is loaded when i do a drop down select option. when i select the first option it works fine. only the second and third i face this problem.

if i use fire bug i see one div empty along with this which i dnt understand y!!!

Code:
</div>

<p class="entry_all_links_container">
<a href="http://localhost/front_end/brands/showAllBrands" id="all_brands_link" class="entry_all_link">alle Marken</a><img  src="http://localhost/front_end/img/shared/frontend_down_arrow.jpg" alt="partition image" />
</p>
<div class="entry_brand_container">
        </div>
</div>
<p class="entry_all_links_container">

<a href="http://localhost/front_end/products/showAllProducts" id="all_products_link" class="entry_all_link">alle Produkte</a><img  src="http://localhost/front_end/img/shared/frontend_down_arrow.jpg" alt="partition image" />

</p>

    </div>

&lt;/body&gt;
&lt;/html&gt;
#9

[eluser]takasia[/eluser]
You have the
&lt;/body&gt;
tag without the start &lt;body&gt; on the begining of the page?
Or is the source not complete?
#10

[eluser]tonanbarbarian[/eluser]
what is the code in _renderFrontendOutput()




Theme © iAndrew 2016 - Forum software by © MyBB