Documentation

SetOptionString

bool
CPageOption::SetOptionString(
 string module_id,
 string name,
 string value = "",
 desc=false
)
page_option_id for the module_id.

The method sets the string value of the page_option_id parameter for the module_id. Returns true on success, or false otherwise. Non-static method.

Parameters

Parameter Description Available from version
module_id Module ID.
page_option_id Arbitrary page parameter ID.
value Parameter value.
Optional, by default - "".
desc Optional, default value - "false".
site Site ID. Default value - "false".

See Also

Examples of use

<?   
// Example illustrates how to prohibit storing the number of the last page in session
// with standard pagewise navigation.
// The last open page of pagewise navigation is remembered in session by default. 
// If you want to change this behavior for the current page, 
// use the following code before CDBResult::NavPrint:
CPageOption::SetOptionString("main", "nav_page_in_session", "N");

// To restore the default mode:
CPageOption::SetOptionString("main", "nav_page_in_session", "Y");
?>


© «Bitrix24», 2001-2024
Up