I want to use php scandir in a phtml





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I want to use this in a phtml:



<?php 
$kataloge_dir = '../media/downloads/dlbereich/kataloge/';
$kataloge = array_diff(scandir($kataloge_dir), array('..', '.'));

$kataloge_thumb_dir = '../media/downloads/dlbereich/kataloge-thumb/';
$kataloge_thumb = array_diff(scandir($kataloge_thumb_dir), array('..', '.'));

$broschueren_dir = '../media/downloads/dlbereich/broschueren/';
$broschueren = array_diff(scandir($broschueren_dir), array('..', '.'));

$broschueren_thumb_dir = '../media/downloads/dlbereich/broschueren-thumb/';
$broschueren_thumb = array_diff(scandir($broschueren_thumb_dir), array('..', '.'));

$flyerlang_dir = '../media/downloads/dlbereich/flyerdinlang/';
$flyerlang = array_diff(scandir($flyerlang_dir), array('..', '.'));

$flyerlang_thumb_dir = '../media/downloads/dlbereich/flyerdinlang-thumb/';
$flyerlang_thumb = array_diff(scandir($flyerlang_thumb_dir), array('..', '.'));

$flyerdin4_dir = '../media/downloads/dlbereich/flyerdina4/';
$flyerdin4 = array_diff(scandir($flyerdin4_dir), array('..', '.'));

$flyerdin4_thumb_dir = '../media/downloads/dlbereich/flyerdina4-thumb/';
$flyerdin4_thumb = array_diff(scandir($flyerdin4_thumb_dir), array('..', '.'));

$preislisten_dir = '../media/downloads/dlbereich/preislisten/';
$preislisten = array_diff(scandir($preislisten_dir), array('..', '.'));

$preislisten_thumb_dir = '../media/downloads/dlbereich/preislisten-thumb/';
$preislisten_thumb = array_diff(scandir($preislisten_thumb_dir), array('..', '.'));

$technik_dir = '../media/downloads/dlbereich/technik/';
$technik = array_diff(scandir($technik_dir), array('..', '.'));

$technik_thumb_dir = '../media/downloads/dlbereich/technik-thumb/';
$technik_thumb = array_diff(scandir($technik_thumb_dir), array('..', '.'));

$poster_dir = '../media/downloads/dlbereich/poster/';
$poster = array_diff(scandir($poster_dir), array('..', '.'));

$poster_thumb_dir = '../media/downloads/dlbereich/poster-thumb/';
$poster_thumb = array_diff(scandir($poster_thumb_dir), array('..', '.'));
?>
<p><h2>Download Übersicht:</h2></p>
<button class="collapsible">Kataloge</button>
<div class="content">
<p>
<?php
foreach ($kataloge as $key => $kataloge_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/kataloge/".$kataloge_link."'>".$kataloge_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/kataloge/".$kataloge_link."'><img src='/media/downloads/dlbereich/kataloge-thumb/".$kataloge_thumb[$key]."' alt='".$kataloge_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Broschüren</button>
<div class="content">
<p>
<?php
foreach ($broschueren as $key1 => $broschueren_link)
{
echo "<div class='boxt'>
<div class='boxt-text2'><a href='/media/downloads/dlbereich/broschueren/".$broschueren_link."'>".$broschueren_link."</a></div><div class='boxt-img2'><a href='/media/downloads/dlbereich/broschueren/".$broschueren_link."'><img src='/media/downloads/dlbereich/broschueren-thumb/".$broschueren_thumb[$key1]."' alt='".$broschueren_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Flyer (DIN lang)</button>
<div class="content">
<p>
<?php
foreach ($flyerlang as $key3 => $flyerlang_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/flyerdinlang/".$flyerlang_link."'>".$flyerlang_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/flyerdinlang/".$flyerlang_link."'><img src='/media/downloads/dlbereich/flyerdinlang-thumb/".$flyerlang_thumb[$key3]."' alt='".$flyerlang_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Flyer (DIN A4)</button>
<div class="content">
<p>
<?php
foreach ($flyerdin4 as $key4 => $flyerdin4_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/flyerdina4".$flyerdin4_link."'>".$flyerdin4_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/flyerdina4/".$flyerdin4_link."'><img src='/media/downloads/dlbereich/flyerdina4-thumb/".$flyerdin4_thumb[$key4]."' alt='".$flyerdin4_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Preislisten</button>
<div class="content">
<p>
<?php
foreach ($preislisten as $key5 => $preislisten_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/preislisten".$preislisten_link."'>".$preislisten_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/preislisten/".$preislisten_link."'><img src='/media/downloads/dlbereich/preislisten-thumb/".$preislisten_thumb[$key5]."' alt='".$preislisten_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Technik</button>
<div class="content">
<p>
<?php
foreach ($technik as $key6 => $technik_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/technik".$technik_link."'>".$technik_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/technik/".$technik_link."'><img src='/media/downloads/dlbereich/technik-thumb/".$technik_thumb[$key6]."' alt='".$technik_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Poster</button>
<div class="content">
<p>
<?php
foreach ($poster as $key7 => $poster_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/poster".$poster_link."'>".$poster_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/poster/".$poster_link."'><img src='/media/downloads/dlbereich/poster-thumb/".$poster_thumb[$key7]."' alt='".$poster_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;

for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.display === "block") {
content.style.display = "none";
} else {
content.style.display = "block";
}
});
}
</script>


Is there a way to use it in Magento 1.9?
I get allways an Error.










share|improve this question


















  • 1





    What error did you get? Also where is this file being used?

    – AJ47
    16 hours ago











  • If i use vardump to get info i get value NULL. I think there is a problem with scandir in Magento. The file is not in use.

    – Marcel
    15 hours ago











  • instead of using relative paths, have you tried using absolute path to the directories?

    – AJ47
    15 hours ago


















0















I want to use this in a phtml:



<?php 
$kataloge_dir = '../media/downloads/dlbereich/kataloge/';
$kataloge = array_diff(scandir($kataloge_dir), array('..', '.'));

$kataloge_thumb_dir = '../media/downloads/dlbereich/kataloge-thumb/';
$kataloge_thumb = array_diff(scandir($kataloge_thumb_dir), array('..', '.'));

$broschueren_dir = '../media/downloads/dlbereich/broschueren/';
$broschueren = array_diff(scandir($broschueren_dir), array('..', '.'));

$broschueren_thumb_dir = '../media/downloads/dlbereich/broschueren-thumb/';
$broschueren_thumb = array_diff(scandir($broschueren_thumb_dir), array('..', '.'));

$flyerlang_dir = '../media/downloads/dlbereich/flyerdinlang/';
$flyerlang = array_diff(scandir($flyerlang_dir), array('..', '.'));

$flyerlang_thumb_dir = '../media/downloads/dlbereich/flyerdinlang-thumb/';
$flyerlang_thumb = array_diff(scandir($flyerlang_thumb_dir), array('..', '.'));

$flyerdin4_dir = '../media/downloads/dlbereich/flyerdina4/';
$flyerdin4 = array_diff(scandir($flyerdin4_dir), array('..', '.'));

$flyerdin4_thumb_dir = '../media/downloads/dlbereich/flyerdina4-thumb/';
$flyerdin4_thumb = array_diff(scandir($flyerdin4_thumb_dir), array('..', '.'));

$preislisten_dir = '../media/downloads/dlbereich/preislisten/';
$preislisten = array_diff(scandir($preislisten_dir), array('..', '.'));

$preislisten_thumb_dir = '../media/downloads/dlbereich/preislisten-thumb/';
$preislisten_thumb = array_diff(scandir($preislisten_thumb_dir), array('..', '.'));

$technik_dir = '../media/downloads/dlbereich/technik/';
$technik = array_diff(scandir($technik_dir), array('..', '.'));

$technik_thumb_dir = '../media/downloads/dlbereich/technik-thumb/';
$technik_thumb = array_diff(scandir($technik_thumb_dir), array('..', '.'));

$poster_dir = '../media/downloads/dlbereich/poster/';
$poster = array_diff(scandir($poster_dir), array('..', '.'));

$poster_thumb_dir = '../media/downloads/dlbereich/poster-thumb/';
$poster_thumb = array_diff(scandir($poster_thumb_dir), array('..', '.'));
?>
<p><h2>Download Übersicht:</h2></p>
<button class="collapsible">Kataloge</button>
<div class="content">
<p>
<?php
foreach ($kataloge as $key => $kataloge_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/kataloge/".$kataloge_link."'>".$kataloge_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/kataloge/".$kataloge_link."'><img src='/media/downloads/dlbereich/kataloge-thumb/".$kataloge_thumb[$key]."' alt='".$kataloge_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Broschüren</button>
<div class="content">
<p>
<?php
foreach ($broschueren as $key1 => $broschueren_link)
{
echo "<div class='boxt'>
<div class='boxt-text2'><a href='/media/downloads/dlbereich/broschueren/".$broschueren_link."'>".$broschueren_link."</a></div><div class='boxt-img2'><a href='/media/downloads/dlbereich/broschueren/".$broschueren_link."'><img src='/media/downloads/dlbereich/broschueren-thumb/".$broschueren_thumb[$key1]."' alt='".$broschueren_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Flyer (DIN lang)</button>
<div class="content">
<p>
<?php
foreach ($flyerlang as $key3 => $flyerlang_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/flyerdinlang/".$flyerlang_link."'>".$flyerlang_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/flyerdinlang/".$flyerlang_link."'><img src='/media/downloads/dlbereich/flyerdinlang-thumb/".$flyerlang_thumb[$key3]."' alt='".$flyerlang_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Flyer (DIN A4)</button>
<div class="content">
<p>
<?php
foreach ($flyerdin4 as $key4 => $flyerdin4_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/flyerdina4".$flyerdin4_link."'>".$flyerdin4_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/flyerdina4/".$flyerdin4_link."'><img src='/media/downloads/dlbereich/flyerdina4-thumb/".$flyerdin4_thumb[$key4]."' alt='".$flyerdin4_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Preislisten</button>
<div class="content">
<p>
<?php
foreach ($preislisten as $key5 => $preislisten_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/preislisten".$preislisten_link."'>".$preislisten_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/preislisten/".$preislisten_link."'><img src='/media/downloads/dlbereich/preislisten-thumb/".$preislisten_thumb[$key5]."' alt='".$preislisten_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Technik</button>
<div class="content">
<p>
<?php
foreach ($technik as $key6 => $technik_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/technik".$technik_link."'>".$technik_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/technik/".$technik_link."'><img src='/media/downloads/dlbereich/technik-thumb/".$technik_thumb[$key6]."' alt='".$technik_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Poster</button>
<div class="content">
<p>
<?php
foreach ($poster as $key7 => $poster_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/poster".$poster_link."'>".$poster_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/poster/".$poster_link."'><img src='/media/downloads/dlbereich/poster-thumb/".$poster_thumb[$key7]."' alt='".$poster_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;

for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.display === "block") {
content.style.display = "none";
} else {
content.style.display = "block";
}
});
}
</script>


Is there a way to use it in Magento 1.9?
I get allways an Error.










share|improve this question


















  • 1





    What error did you get? Also where is this file being used?

    – AJ47
    16 hours ago











  • If i use vardump to get info i get value NULL. I think there is a problem with scandir in Magento. The file is not in use.

    – Marcel
    15 hours ago











  • instead of using relative paths, have you tried using absolute path to the directories?

    – AJ47
    15 hours ago














0












0








0








I want to use this in a phtml:



<?php 
$kataloge_dir = '../media/downloads/dlbereich/kataloge/';
$kataloge = array_diff(scandir($kataloge_dir), array('..', '.'));

$kataloge_thumb_dir = '../media/downloads/dlbereich/kataloge-thumb/';
$kataloge_thumb = array_diff(scandir($kataloge_thumb_dir), array('..', '.'));

$broschueren_dir = '../media/downloads/dlbereich/broschueren/';
$broschueren = array_diff(scandir($broschueren_dir), array('..', '.'));

$broschueren_thumb_dir = '../media/downloads/dlbereich/broschueren-thumb/';
$broschueren_thumb = array_diff(scandir($broschueren_thumb_dir), array('..', '.'));

$flyerlang_dir = '../media/downloads/dlbereich/flyerdinlang/';
$flyerlang = array_diff(scandir($flyerlang_dir), array('..', '.'));

$flyerlang_thumb_dir = '../media/downloads/dlbereich/flyerdinlang-thumb/';
$flyerlang_thumb = array_diff(scandir($flyerlang_thumb_dir), array('..', '.'));

$flyerdin4_dir = '../media/downloads/dlbereich/flyerdina4/';
$flyerdin4 = array_diff(scandir($flyerdin4_dir), array('..', '.'));

$flyerdin4_thumb_dir = '../media/downloads/dlbereich/flyerdina4-thumb/';
$flyerdin4_thumb = array_diff(scandir($flyerdin4_thumb_dir), array('..', '.'));

$preislisten_dir = '../media/downloads/dlbereich/preislisten/';
$preislisten = array_diff(scandir($preislisten_dir), array('..', '.'));

$preislisten_thumb_dir = '../media/downloads/dlbereich/preislisten-thumb/';
$preislisten_thumb = array_diff(scandir($preislisten_thumb_dir), array('..', '.'));

$technik_dir = '../media/downloads/dlbereich/technik/';
$technik = array_diff(scandir($technik_dir), array('..', '.'));

$technik_thumb_dir = '../media/downloads/dlbereich/technik-thumb/';
$technik_thumb = array_diff(scandir($technik_thumb_dir), array('..', '.'));

$poster_dir = '../media/downloads/dlbereich/poster/';
$poster = array_diff(scandir($poster_dir), array('..', '.'));

$poster_thumb_dir = '../media/downloads/dlbereich/poster-thumb/';
$poster_thumb = array_diff(scandir($poster_thumb_dir), array('..', '.'));
?>
<p><h2>Download Übersicht:</h2></p>
<button class="collapsible">Kataloge</button>
<div class="content">
<p>
<?php
foreach ($kataloge as $key => $kataloge_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/kataloge/".$kataloge_link."'>".$kataloge_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/kataloge/".$kataloge_link."'><img src='/media/downloads/dlbereich/kataloge-thumb/".$kataloge_thumb[$key]."' alt='".$kataloge_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Broschüren</button>
<div class="content">
<p>
<?php
foreach ($broschueren as $key1 => $broschueren_link)
{
echo "<div class='boxt'>
<div class='boxt-text2'><a href='/media/downloads/dlbereich/broschueren/".$broschueren_link."'>".$broschueren_link."</a></div><div class='boxt-img2'><a href='/media/downloads/dlbereich/broschueren/".$broschueren_link."'><img src='/media/downloads/dlbereich/broschueren-thumb/".$broschueren_thumb[$key1]."' alt='".$broschueren_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Flyer (DIN lang)</button>
<div class="content">
<p>
<?php
foreach ($flyerlang as $key3 => $flyerlang_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/flyerdinlang/".$flyerlang_link."'>".$flyerlang_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/flyerdinlang/".$flyerlang_link."'><img src='/media/downloads/dlbereich/flyerdinlang-thumb/".$flyerlang_thumb[$key3]."' alt='".$flyerlang_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Flyer (DIN A4)</button>
<div class="content">
<p>
<?php
foreach ($flyerdin4 as $key4 => $flyerdin4_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/flyerdina4".$flyerdin4_link."'>".$flyerdin4_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/flyerdina4/".$flyerdin4_link."'><img src='/media/downloads/dlbereich/flyerdina4-thumb/".$flyerdin4_thumb[$key4]."' alt='".$flyerdin4_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Preislisten</button>
<div class="content">
<p>
<?php
foreach ($preislisten as $key5 => $preislisten_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/preislisten".$preislisten_link."'>".$preislisten_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/preislisten/".$preislisten_link."'><img src='/media/downloads/dlbereich/preislisten-thumb/".$preislisten_thumb[$key5]."' alt='".$preislisten_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Technik</button>
<div class="content">
<p>
<?php
foreach ($technik as $key6 => $technik_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/technik".$technik_link."'>".$technik_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/technik/".$technik_link."'><img src='/media/downloads/dlbereich/technik-thumb/".$technik_thumb[$key6]."' alt='".$technik_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Poster</button>
<div class="content">
<p>
<?php
foreach ($poster as $key7 => $poster_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/poster".$poster_link."'>".$poster_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/poster/".$poster_link."'><img src='/media/downloads/dlbereich/poster-thumb/".$poster_thumb[$key7]."' alt='".$poster_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;

for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.display === "block") {
content.style.display = "none";
} else {
content.style.display = "block";
}
});
}
</script>


Is there a way to use it in Magento 1.9?
I get allways an Error.










share|improve this question














I want to use this in a phtml:



<?php 
$kataloge_dir = '../media/downloads/dlbereich/kataloge/';
$kataloge = array_diff(scandir($kataloge_dir), array('..', '.'));

$kataloge_thumb_dir = '../media/downloads/dlbereich/kataloge-thumb/';
$kataloge_thumb = array_diff(scandir($kataloge_thumb_dir), array('..', '.'));

$broschueren_dir = '../media/downloads/dlbereich/broschueren/';
$broschueren = array_diff(scandir($broschueren_dir), array('..', '.'));

$broschueren_thumb_dir = '../media/downloads/dlbereich/broschueren-thumb/';
$broschueren_thumb = array_diff(scandir($broschueren_thumb_dir), array('..', '.'));

$flyerlang_dir = '../media/downloads/dlbereich/flyerdinlang/';
$flyerlang = array_diff(scandir($flyerlang_dir), array('..', '.'));

$flyerlang_thumb_dir = '../media/downloads/dlbereich/flyerdinlang-thumb/';
$flyerlang_thumb = array_diff(scandir($flyerlang_thumb_dir), array('..', '.'));

$flyerdin4_dir = '../media/downloads/dlbereich/flyerdina4/';
$flyerdin4 = array_diff(scandir($flyerdin4_dir), array('..', '.'));

$flyerdin4_thumb_dir = '../media/downloads/dlbereich/flyerdina4-thumb/';
$flyerdin4_thumb = array_diff(scandir($flyerdin4_thumb_dir), array('..', '.'));

$preislisten_dir = '../media/downloads/dlbereich/preislisten/';
$preislisten = array_diff(scandir($preislisten_dir), array('..', '.'));

$preislisten_thumb_dir = '../media/downloads/dlbereich/preislisten-thumb/';
$preislisten_thumb = array_diff(scandir($preislisten_thumb_dir), array('..', '.'));

$technik_dir = '../media/downloads/dlbereich/technik/';
$technik = array_diff(scandir($technik_dir), array('..', '.'));

$technik_thumb_dir = '../media/downloads/dlbereich/technik-thumb/';
$technik_thumb = array_diff(scandir($technik_thumb_dir), array('..', '.'));

$poster_dir = '../media/downloads/dlbereich/poster/';
$poster = array_diff(scandir($poster_dir), array('..', '.'));

$poster_thumb_dir = '../media/downloads/dlbereich/poster-thumb/';
$poster_thumb = array_diff(scandir($poster_thumb_dir), array('..', '.'));
?>
<p><h2>Download Übersicht:</h2></p>
<button class="collapsible">Kataloge</button>
<div class="content">
<p>
<?php
foreach ($kataloge as $key => $kataloge_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/kataloge/".$kataloge_link."'>".$kataloge_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/kataloge/".$kataloge_link."'><img src='/media/downloads/dlbereich/kataloge-thumb/".$kataloge_thumb[$key]."' alt='".$kataloge_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Broschüren</button>
<div class="content">
<p>
<?php
foreach ($broschueren as $key1 => $broschueren_link)
{
echo "<div class='boxt'>
<div class='boxt-text2'><a href='/media/downloads/dlbereich/broschueren/".$broschueren_link."'>".$broschueren_link."</a></div><div class='boxt-img2'><a href='/media/downloads/dlbereich/broschueren/".$broschueren_link."'><img src='/media/downloads/dlbereich/broschueren-thumb/".$broschueren_thumb[$key1]."' alt='".$broschueren_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Flyer (DIN lang)</button>
<div class="content">
<p>
<?php
foreach ($flyerlang as $key3 => $flyerlang_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/flyerdinlang/".$flyerlang_link."'>".$flyerlang_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/flyerdinlang/".$flyerlang_link."'><img src='/media/downloads/dlbereich/flyerdinlang-thumb/".$flyerlang_thumb[$key3]."' alt='".$flyerlang_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Flyer (DIN A4)</button>
<div class="content">
<p>
<?php
foreach ($flyerdin4 as $key4 => $flyerdin4_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/flyerdina4".$flyerdin4_link."'>".$flyerdin4_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/flyerdina4/".$flyerdin4_link."'><img src='/media/downloads/dlbereich/flyerdina4-thumb/".$flyerdin4_thumb[$key4]."' alt='".$flyerdin4_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Preislisten</button>
<div class="content">
<p>
<?php
foreach ($preislisten as $key5 => $preislisten_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/preislisten".$preislisten_link."'>".$preislisten_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/preislisten/".$preislisten_link."'><img src='/media/downloads/dlbereich/preislisten-thumb/".$preislisten_thumb[$key5]."' alt='".$preislisten_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Technik</button>
<div class="content">
<p>
<?php
foreach ($technik as $key6 => $technik_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/technik".$technik_link."'>".$technik_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/technik/".$technik_link."'><img src='/media/downloads/dlbereich/technik-thumb/".$technik_thumb[$key6]."' alt='".$technik_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<button class="collapsible">Poster</button>
<div class="content">
<p>
<?php
foreach ($poster as $key7 => $poster_link)
{
echo "<div class='boxt'>
<div class='boxt-text'><a href='/media/downloads/dlbereich/poster".$poster_link."'>".$poster_link."</a></div><div class='boxt-img'><a href='/media/downloads/dlbereich/poster/".$poster_link."'><img src='/media/downloads/dlbereich/poster-thumb/".$poster_thumb[$key7]."' alt='".$poster_link."' /></a></div>
</div><br>";
}
?>
</p>
</div>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;

for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.display === "block") {
content.style.display = "none";
} else {
content.style.display = "block";
}
});
}
</script>


Is there a way to use it in Magento 1.9?
I get allways an Error.







magento-1.9 php url file






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 16 hours ago









MarcelMarcel

11012




11012








  • 1





    What error did you get? Also where is this file being used?

    – AJ47
    16 hours ago











  • If i use vardump to get info i get value NULL. I think there is a problem with scandir in Magento. The file is not in use.

    – Marcel
    15 hours ago











  • instead of using relative paths, have you tried using absolute path to the directories?

    – AJ47
    15 hours ago














  • 1





    What error did you get? Also where is this file being used?

    – AJ47
    16 hours ago











  • If i use vardump to get info i get value NULL. I think there is a problem with scandir in Magento. The file is not in use.

    – Marcel
    15 hours ago











  • instead of using relative paths, have you tried using absolute path to the directories?

    – AJ47
    15 hours ago








1




1





What error did you get? Also where is this file being used?

– AJ47
16 hours ago





What error did you get? Also where is this file being used?

– AJ47
16 hours ago













If i use vardump to get info i get value NULL. I think there is a problem with scandir in Magento. The file is not in use.

– Marcel
15 hours ago





If i use vardump to get info i get value NULL. I think there is a problem with scandir in Magento. The file is not in use.

– Marcel
15 hours ago













instead of using relative paths, have you tried using absolute path to the directories?

– AJ47
15 hours ago





instead of using relative paths, have you tried using absolute path to the directories?

– AJ47
15 hours ago










1 Answer
1






active

oldest

votes


















0














This has nothing to loose in a .phtml you have to create a block class and put your PHP there.



Always keep the php in template files to a minimum.



https://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-4.html






share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "479"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268945%2fi-want-to-use-php-scandir-in-a-phtml%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    This has nothing to loose in a .phtml you have to create a block class and put your PHP there.



    Always keep the php in template files to a minimum.



    https://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-4.html






    share|improve this answer




























      0














      This has nothing to loose in a .phtml you have to create a block class and put your PHP there.



      Always keep the php in template files to a minimum.



      https://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-4.html






      share|improve this answer


























        0












        0








        0







        This has nothing to loose in a .phtml you have to create a block class and put your PHP there.



        Always keep the php in template files to a minimum.



        https://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-4.html






        share|improve this answer













        This has nothing to loose in a .phtml you have to create a block class and put your PHP there.



        Always keep the php in template files to a minimum.



        https://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-4.html







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 14 hours ago









        BlackBlack

        420320




        420320






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268945%2fi-want-to-use-php-scandir-in-a-phtml%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            What other Star Trek series did the main TNG cast show up in?

            Berlina muro

            Berlina aerponto