mirror of
				https://github.com/kevinveenbirkenbach/coding-challenge-online-shop.git
				synced 2025-11-04 11:07:58 +00:00 
			
		
		
		
	Added first draft Homepage
This commit is contained in:
		@@ -2,6 +2,7 @@
 | 
			
		||||
namespace router;
 | 
			
		||||
 | 
			
		||||
use core\CoreInterface;
 | 
			
		||||
use controller\standart\Standart;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
@@ -10,19 +11,58 @@ use core\CoreInterface;
 | 
			
		||||
 */
 | 
			
		||||
final class Router implements RouterInterface
 | 
			
		||||
{
 | 
			
		||||
    public function route()
 | 
			
		||||
    /**
 | 
			
		||||
     * @var CoreInterface
 | 
			
		||||
     */
 | 
			
		||||
    private $core;
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * 
 | 
			
		||||
     * @var array
 | 
			
		||||
     */
 | 
			
		||||
    private $get;
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * 
 | 
			
		||||
     * @var array
 | 
			
		||||
     */
 | 
			
		||||
    private $post;
 | 
			
		||||
    
 | 
			
		||||
    public function route():void
 | 
			
		||||
    {
 | 
			
		||||
        echo "Hello World!";
 | 
			
		||||
        if($this->post['route']){
 | 
			
		||||
            $this->postRouting();
 | 
			
		||||
        }
 | 
			
		||||
        if($this->get['router']){
 | 
			
		||||
            $this->getRouting();
 | 
			
		||||
        }else{
 | 
			
		||||
            $standart = new Standart($this->core);
 | 
			
		||||
            $standart->homepage();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    private function postRouting():void{
 | 
			
		||||
        
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    private function getRouting():void{
 | 
			
		||||
        
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setGet(array $get)
 | 
			
		||||
    {}
 | 
			
		||||
    public function setGet(array $get):void
 | 
			
		||||
    {
 | 
			
		||||
        $this->get = $get;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setCore(CoreInterface $core)
 | 
			
		||||
    {}
 | 
			
		||||
    public function setCore(CoreInterface $core):void
 | 
			
		||||
    {
 | 
			
		||||
        $this->core = $core;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setPost(array $post): void
 | 
			
		||||
    {}
 | 
			
		||||
    {
 | 
			
		||||
        $this->post = $post;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ use core\CoreInterface;
 | 
			
		||||
 */
 | 
			
		||||
interface RouterInterface
 | 
			
		||||
{
 | 
			
		||||
    public function setCore(CoreInterface $core);
 | 
			
		||||
    public function setCore(CoreInterface $core):void;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Post parameters are used to save data
 | 
			
		||||
@@ -22,10 +22,10 @@ interface RouterInterface
 | 
			
		||||
     * Get Parameters are used to request Data
 | 
			
		||||
     * @param array $get
 | 
			
		||||
     */
 | 
			
		||||
    public function setGet(array $get);
 | 
			
		||||
    public function setGet(array $get):void;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Opens the controller
 | 
			
		||||
     */
 | 
			
		||||
    public function route();
 | 
			
		||||
    public function route():void;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user