/ Published in: Other
Expand |
Embed | Plain Text
/app/error.php ------------------- <?php class AppError extends ErrorHandler { // 大元の"error"アクションをオーバーライド function error($params) { extract($params, EXTR_OVERWRITE); // 引き継ぐ配列の内容をセット $this->controller->set(array( 'code' => $code, 'name' => $name, 'url' => $url, 'message' => $message, 'title' => $code . ' ' . $name )); // _outputMessage = view のctpのファイル名 $this->__outputMessage('message'); } } ?> /app/views/errors/message.ctp ------------------- <h2><?php echo $name; ?></h2> <p class="error"> カスタムエラーページ<br> <strong><?php __('Error'); ?>: </strong> <?php echo sprintf(__("The requested address %s was not found on this server.", true), "<strong>'{$message}'</strong>")?><br> URL:<?php echo $url ?> </p>
You need to login to post a comment.
