2

I am trying to display a graph of employee statistics in the module

My function in controller

public function GraphicInfoAction()
    {
        $username = $this->getRequest()->getParam('username');
        if (!empty($username)) {
            $this->loadLayout();
            $this->_title($this->__("Testing module statistic" . $username));
            $this->_addContent($this->getLayout()->createBlock("testing/adminhtml_testing_graphic"));

            $result = Mage::helper('testing/data')->getDataByLastDay($username);

            $this->renderLayout();
        } else {
            Mage::getSingleton('adminhtml/session')->addError('Please, select correctly user');
            return $this->_redirect('*/*/');
        }
    }

In block i created Graphic.php file

class DaniilKrok_Testing_Block_Adminhtml_Testing_Graphic extends Mage_Adminhtml_Block_Abstract
{
    public function _toHtml()
    {
        var_dump('here');
        exit;
        //include 'Graphic.phtml';
    }
}

I don't really like connecting here .phtml file If i include .phtml file in result i have this

enter image description here

Tell me how this logic can be implemented correctly?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.