Demo entry 6338148

poo_index

   

Submitted by anonymous on Dec 10, 2016 at 15:33
Language: PHP. Code size: 1.5 kB.

<?php

require_once './includes/php/Cabeza.php';
require_once './includes/php/Container.php';
    require_once './includes/php/Encabezado.php';
    require_once './includes/php/Content.php';
        require_once './includes/php/Nav.php';
            require_once './includes/php/Item.php';
        require_once './includes/php/Maine.php';
    require_once './includes/php/Footer.php';

/* Esta clase es la index */
class Index
{
   public function cambiemos()
    {
        $oCabeza = new Cabeza();
        $oContainer = new Container();
        $oEncabezado = new Encabezado();
        $oContent = new Content();
        $oNav = new Nav();
        $oFooter = new Footer();

        //creamos los items que van en el panel de navegacion
        $oItemHome = new Item('Home','home','index.php');
        $oNav->addItem($oItemHome);

        $oItemLogin = new Item('Login','hand-o-right','login/index.php');
        $oNav->addItem($oItemLogin);

        $oItemLogin = new Item('Contacto','child','login/index.php');
        $oNav->addItem($oItemLogin);
        
        //creamos el contenido especifico
        $oMaine = new Maine();

        //armamos el div content
        $oContent->addNav($oNav);
        $oContent->addMaine($oMaine);
        
        //juntamos 
        $oContainer->addCabeza($oCabeza);
        $oContainer->addEncabezado($oEncabezado);
        $oContainer->addContent($oContent);
        $oContainer->addFooter($oFooter);

        echo $oContainer->drawHtml();
    }
}

$oIndex = new Index();
$oIndex->cambiemos();

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).