1

I am new in joomla, My code is like this

//on controller
function listing()
    {
            JRequest::setVar( 'view', 'hello' );
            JRequest::setVar('hidemainmenu', 0);
            parent::display();                  
    }
//on view.html.php 

i want to fetch this 'hidemainmenu' How can i fetch can anyone help??

1
  • sorry to take your time JRequest::getVar('hidemainmenu') Commented Mar 15, 2011 at 10:51

2 Answers 2

2

If the code above is that of your view.html.php file then you can pass the variable through to your template file by using a line like so:

$this->assignRef( 'hidemainmenu', $hidemainmenu);

Then in your tmpl/default.php file for example you can access this variable like so:

$this->hidemainmenu
Sign up to request clarification or add additional context in comments.

2 Comments

I was in the middle of posting the same thing.
to get the $hidemainmenu in the first place, I recommend using this if need be. $hidemainmenu = JRequest::getVar('hidemainmenu');
0

If the code is in the Controller : get the Variable in the view.html.php

as

$hidemainmenu = JRequest::getVar('hidemainmenu');

Try this in the view.html.php or default.php

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.