Skip to main content
replaced http://joomla.stackexchange.com/ with https://joomla.stackexchange.com/
Source Link

This might a simple question, I've Model State variable set in my Model. When I "print_r" it in view. It provides following output:

JObject Object
(
    [_errors:protected] => Array
        (
        )

    [task] => 
    [request.id] => 3
    [params] => Joomla\Registry\Registry Object
        (
            [data:protected] => stdClass Object
                (
                    [path] => /media/com_helpdesk/files/
                )

            [separator] => .
        )

)

I can access 'task', 'params' variable in my view.html.php as follows:

echo $this->get('State')->params

my question is, How can I access "request.id" variable in similar way.

i.e. echo $this->get('State')->request.id

Above is (of course) not working due to additional ". (dot)".

Please note that this question is not duplicate of From the model, how I can access the data retrieved in the view?From the model, how I can access the data retrieved in the view? as I am trying to print variable with "dot" operator

This might a simple question, I've Model State variable set in my Model. When I "print_r" it in view. It provides following output:

JObject Object
(
    [_errors:protected] => Array
        (
        )

    [task] => 
    [request.id] => 3
    [params] => Joomla\Registry\Registry Object
        (
            [data:protected] => stdClass Object
                (
                    [path] => /media/com_helpdesk/files/
                )

            [separator] => .
        )

)

I can access 'task', 'params' variable in my view.html.php as follows:

echo $this->get('State')->params

my question is, How can I access "request.id" variable in similar way.

i.e. echo $this->get('State')->request.id

Above is (of course) not working due to additional ". (dot)".

Please note that this question is not duplicate of From the model, how I can access the data retrieved in the view? as I am trying to print variable with "dot" operator

This might a simple question, I've Model State variable set in my Model. When I "print_r" it in view. It provides following output:

JObject Object
(
    [_errors:protected] => Array
        (
        )

    [task] => 
    [request.id] => 3
    [params] => Joomla\Registry\Registry Object
        (
            [data:protected] => stdClass Object
                (
                    [path] => /media/com_helpdesk/files/
                )

            [separator] => .
        )

)

I can access 'task', 'params' variable in my view.html.php as follows:

echo $this->get('State')->params

my question is, How can I access "request.id" variable in similar way.

i.e. echo $this->get('State')->request.id

Above is (of course) not working due to additional ". (dot)".

Please note that this question is not duplicate of From the model, how I can access the data retrieved in the view? as I am trying to print variable with "dot" operator

Source Link
Sahil Purav
  • 1.3k
  • 1
  • 8
  • 28

Access Model State Variable in View

This might a simple question, I've Model State variable set in my Model. When I "print_r" it in view. It provides following output:

JObject Object
(
    [_errors:protected] => Array
        (
        )

    [task] => 
    [request.id] => 3
    [params] => Joomla\Registry\Registry Object
        (
            [data:protected] => stdClass Object
                (
                    [path] => /media/com_helpdesk/files/
                )

            [separator] => .
        )

)

I can access 'task', 'params' variable in my view.html.php as follows:

echo $this->get('State')->params

my question is, How can I access "request.id" variable in similar way.

i.e. echo $this->get('State')->request.id

Above is (of course) not working due to additional ". (dot)".

Please note that this question is not duplicate of From the model, how I can access the data retrieved in the view? as I am trying to print variable with "dot" operator