本文整理匯總了PHP中ViewManager::addSuccessMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP ViewManager::addSuccessMessage方法的具體用法?PHP ViewManager::addSuccessMessage怎麽用?PHP ViewManager::addSuccessMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ViewManager
的用法示例。
在下文中一共展示了ViewManager::addSuccessMessage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addSuccessMessage
/**
* Add success message to view
* Include field if the message goes on a specific place on the page; otherwise leave it null for the message
* to be page-level.
* @param str $msg
* @param str $field Defaults to null for page-level messages.
* @param bool $disable_xss Disable HTML encoding tags, defaults to false
*/
public function addSuccessMessage($msg, $field = null, $disable_xss = false)
{
$this->disableCaching();
$this->view_mgr->addSuccessMessage($msg, $field, $disable_xss);
}
示例2: testAddSuccessMessage
public function testAddSuccessMessage()
{
$cfg = Config::getInstance();
$cfg->setValue('debug', true);
$v_mgr = new ViewManager();
$v_mgr->addSuccessMessage('Field level info 1', 'fieldname1');
$v_mgr->addSuccessMessage('Page level info');
$v_mgr->addSuccessMessage('Field level info 2', 'fieldname2');
$this->assertEqual($v_mgr->getTemplateDataItem('success_msg'), 'Page level info');
$debug_arr = $v_mgr->getTemplateDataItem('success_msgs');
$this->assertEqual($debug_arr['fieldname1'], 'Field level info 1');
$this->assertEqual($debug_arr['fieldname2'], 'Field level info 2');
$this->debug(Utils::varDumpToString($debug_arr));
}