contao/core — pull request #4556 by tsarma (2012-07-23 12:19:38+00:00)
Title: Pass customs values set inside $GLOBALS['TL_HOOKS']['getForm'], from class Hybrid to class Form  

With a hook $GLOBALS['TL_HOOKS']['getForm'], i am setting jumpTo page ID dynamically as in floowing code snippet.

// Inside a Hook function for $GLOBALS['TL_HOOKS']['getForm']
public function getFormHook($objRow, $strBuffer)
{
$objRow->jumpTo = 128; //<- dynamic value
$objElements = new Form($objRow);
$strBuffer = $objElements->generate();
return $strBuffer;
}

Inside Hybrid.php I defined a
protected member $objElement
and added
$this->objElement = $objElement;
to the constructor function of Hybrid class

Now inside From.php at about line 240
// Get target URL
if ($this->method == 'GET')
{
$objNextPage = $this->Database->prepare("SELECT id, alias FROM tl_page WHERE id=?")
->limit(1)
->execute(($this->objElement->jumpTo !='')? $this->objElement->jumpTo : $this->jumpTo);

if ($objNextPage->numRows)
{
$this->Template->action = $this->generateFrontendUrl($objNextPage->fetchAssoc());
}
}