views:

45

answers:

3

Hi,

Zend Framework :: How should title html element get from view?(set view->headTitle()).

Example of view title output source: (I need to get: some browser title)

<title> some browser title </title>

My Code that print huge array:

$this->view->headTitle('some browser title');//set working
echo var_export($this->headTitle()); //get not working

please help to get title element of the view.

Thanks

+1  A: 

Think it should be:

$this->view->headTitle('some browser title');

to set the page title.

simnom
this is not the reason, in real code it was also $this->view->headTitle
Yosef
A: 

Change your set to:

$this->view->headTitle('some browser title');

and your get to:

echo var_export($this->headTitle);

(notice the removal of the "()" after headTitle).

William
this is not the reason, in real code it was also $this->view->headTitle
Yosef
Please also see my suggested change to the get (just edited my post to add it).
William
Notice: Undefined property: ... $headTitle in ....
Yosef
+4  A: 

In view

$this->headTitle('some browser title');
echo $this->headTitle(); //<title>some browser title<title>
echo strip_tags($this->headTitle()); //some browser title
ngsiolei
still not working
Yosef
I try again, and its works! great solution. Thanks!!
Yosef