I want to show or hide contents of the web page on hyperlink click.
My webpage has a link "Hide content" which on click it changes to "Show Content". Only admins can see this link. If the admin user has set "hide content", the non-admin users can not see the contents on the page and the non-admins can never see the link.
I am trying to achieve this without using the Database, but using a global flag.
I tried using parameters like this:
Yii::app()->params[‘hideContents’] = true;
But the parameter value does not persist across pages.
Is there a way where global parameters can persist forever. Based on this parameter I want to show or hide the contents for the admin and non admin users on the page.
Yii::app()->params[‘paramName’] is set in configuration file and should be available at every part of the website this configuration applies to. Check if the part of website where you cannot call that parameter is using different configuration.
The set value for the param is accessible. But I want to set new value for the parameter and then want to access the changed value everywhere. The changed value persists only on that page and if I reload the page, the param value from the config is fetched and not the changed value.