CS-Cart: 通知関数fn_set_notificationの使い方
CS-Cartでは、処理の成功・失敗などをUIにフィードバックできる通知(notification)の機構がある。Ruby on Railsなどのフレームワークでよく見かけるflash的なものだ。
この通知は、fn_set_notification
を実行すると使うことができる。
fn_set_notification
通知関数の引数などは次のようになっている。
/**
* Sets notification message
*
* @param string $type notification type (E - error, W - warning, N - notice, O - order error on checkout, I - information)
* @param string $title notification title
* @param string $message notification message
* @param string $message_state (S - notification will be displayed unless it's closed, K - only once, I - will be closed by timer)
* @param mixed $extra extra data to save with notification
* @param bool $init_message $title and $message will be processed by __ function if true
* @return boolean always true
*/
function fn_set_notification($type, $title, $message, $message_state = '', $extra = '', $init_message = false)
サンプル
fn_set_notification('E', __('error'), '失敗しました');
fn_set_notification('W', __('important'), '注意してください');
fn_set_notification('W', __('warning'), '注意してください');
fn_set_notification('N', __('notice'), '成功しました');
fn_set_notification('N', __('congratulations'), 'ついに成功しました');
fn_set_notification('S', __('notice'), 'アップデートがあります');
fn_set_notification('W', __('warning'), '問題が有ります。<a href="#">詳しく</a>');
Author And Source
この問題について(CS-Cart: 通知関数fn_set_notificationの使い方), 我々は、より多くの情報をここで見つけました https://qiita.com/suin/items/a325fe97905ae5e1f6ba著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .