Jump to content

HerrPNut

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by HerrPNut

  1. ok thanks! Your solution works perfectly
  2. Hellow, I have an array $arr with keys and values, I can display the values if i define a key: <?php $arr = array("foo" => "bar", 12 => true); echo $arr["foo"]; // bar echo $arr[12]; // 1 ?> but i want to display all the keys from the array In this example this would be: foo and 12
  3. now it shows me "it works" So the problem has to be in the controller class? this is the controller class code: class controller extends ControllerBase { function index() { include_once('../model/gebruiker.php'); $gebruiker = new GebruikerModel(); if (isset ($_GET['id'])) { if(is_numeric($_GET['id'])) { /** * Haal de waardes uit de database. Het model zet deze in de klasse variabelen * dus kunnen we ze aanroepen met $object_naam->klassevariabelenaam; */ $id = $_GET['id']; $getGebruiker = $gebruiker->getGebruiker($id); $gebruikernaam = $gebruiker->get_naam(); $gebruikervoornaam = $gebruiker->get_voornaam(); /** * Zet de verschillende waardes in het register zodat we deze in de view kunnen gebruiken */ $this->registry['template']->set('naam',$gebruikernaam); $this->registry['template']->set('voornaam',$gebruikervoornaam); /** * Verwijzing naar de view. * Dit laat de view met de naam wat tussen de haken van show staat. * Hier is het dus de view media. Deze staat in de map templates en * heeft de naam <viewnaam>.php */ $this->registry['template']->show('gebruiker'); } }else { /** * Er is geen media id meegegeven in de url dus toon gewoon de view. * Hier kan je natuurlijk ook een model functie aanroepen die alle categorien * laat zien zoals we dat in het voorbeeld gaan doen. */ $this->registry['template']->show('gebruiker'); } } } edit: if i remove the "extends controllerBase" everything works... this is the code from controllerbase: <?php abstract class ControllerBase { protected $registry; function __construct($registry) { $this->registry = $registry; } abstract function index(); } ?> but Controller HAS to inherit ControllerBase
  4. it shows controller.php if i check if the file exisits: if (file_exists($this->file)){ echo 'EXISTS<br />'; }else{ echo 'EXISTS NOT<br />'; } it shows EXISTS
  5. I have a weird problem. I declare $this->file = 'controller.php'; then include($this->file); and nothing happens. When I surround the include with an if-statement: if(include($this->file)) { echo "OK"; } else { echo "NOT OK"; } I get this error: *Warning: include() [function.include]: Filename cannot be empty in C:\wamp\www\...\ on line 70
  6. ok, if i say: show 9 images, the script shows 9 images and then... if i click on "2" for second page, he doens't show me the rest of the images (in total there are 12, so there should be 3 more images)
  7. it isn't hard coded: <?php if(!empty($_GET["evenement"])){ $evenement = $_GET["evenement"]; $naam = $_GET["naam"]; echo "<h2>".$naam."</h2>"; if($handle = opendir("pics/".$evenement)) { while(($read = readdir($handle)) !== false) { if ($read != "." && $read != ".."){ echo "<div class=\"img\">"; echo "<a href=\"pics/".$evenement."/".$read."\" rel=\"lightbox[".$evenement."]\"><img src =\"pics/".$evenement."/".$read."\" border = \"0\"/ width=\"110\" height=\"90\" /></a>"; ..... ?>
  8. Hello to everyone! I am setting up a site in php and I came across a problem. I made a photo-album without SQL, only php. At the moment all the photos are displayed on 1 page, but I tought it would be better with pagination (after 12 photos) Is it possible without SQL? ifzo how can i do it? cheers Robin
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.