HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/tops.komma.pro/wwwroot/lib/content/content_block.class.php
<?php
/**
 * content_block.class.php
 * Created by Komma Mediadesign.
 * Author: mike
 * Date: 13/02/14
 */

class Content_Block
{
    /*
     * Block with rows - XML Object
     * (f.e. "Article")
     */
    protected $block;

    // Language
    protected $lang;
    protected $urls;

    /*
     * Constructor
     */
    public function __construct()
    {
        // Set language and url for conversion
        $Translator = new Translator(URL_LANG);
        $this->lang = $Translator->get();
        $this->urls = $Translator->getUrls();
    }

    /*
     * Generate content
     * Check what blocks to generate
     */
    public function generate()
    {


        // Output
        $output = '';

        $key = 0;
        foreach($this->block->row as $row)
        {
            // Get values
            $type = $row->attributes()->type;

            if($row)
            {
                // generate method name
                $methodName = str_replace('_',' ',$type);
                $methodName = ucwords($methodName);
                $methodName = 'get' . str_replace(' ','',$methodName);

                // call method
                if(method_exists($this,$methodName))
                {
                    $output .= $this->{$methodName}($row);
                }
            }
            $key++;
        }
        return $output;
    }
}