प्रारंभ संपादित
ठीक नीचे काम करता है, लेकिन मैं एक बेहतर तरीका मिल गया। अपने नियंत्रक में क्या ...
if (JRequest::getVar('format') != 'raw') {
$url = JURI::current() . '?' . $_SERVER['QUERY_STRING'] . '&format=raw';
header('Location: ' . $url);
// or, if you want Content-type of text/html just use ...
// redirect($url);
}
समाप्ति संपादित
आप Tmpl '' घटक 'पर सेट कर सकते हैं, के रूप में की तरह, बाबर Usenakunov ने सुझाव दिया है, जिसमें मामले स्क्रिप्ट और सीएसएस लोड किया जा सकता है, .. ।
JRequest::setVar('tmpl','component');
आप कच्चे उत्पादन बनाना चाहते हैं लेकिन यदि आप & प्रारूप = कच्चे या अपने घटक में जोड़ने प्रकार के 'कच्चे' एक दृश्य बना सकते हैं ...
दुर्भाग्य से केवल कार्यात्मक तरह से मैं कच्चे के एक viewType सही ढंग से प्रस्तुत करना सुनिश्चित करने के लिए मिल सकता है बाहर निकलें() कॉल करने के लिए दृश्य कक्षा के बाद माता-पिता :: प्रदर्शन() कहता है ...
अपने controller.php में है ...
class com_whateverController() extends JController
{
function __construct()
{
// the following is not required if you call exit() in your view class (see below) ...
JRequest::setVar('format','raw');
JFactory::$document = null;
JFactory::getDocument();
// or
//JFactory::$document = JDocument::getInstance('raw');
parent::__construct();
}
function display()
{
$view = $this->getView('whatever', 'raw');
$view->display();
}
}
तो विचारों में
/जो कुछ भी/view.raw.php ...
class com_whateverViewWhatever extends JView
{
public function display($tpl = null)
{
parent::display();
exit; // <- if you dont have this then the output is captured in and output buffer and then lost in the rendering
}
}
धन्यवाद! Avesome! – Nips
"_creating" घटक.php "टेम्पलेट के रूट फ़ोल्डर_ में फ़ाइल" पर विश्वास नहीं कर सकता "यह मेरे लिए कभी नहीं हुआ। – Ejaz