[Solar-svn] Revision 3036
pmjones at solarphp.com
pmjones at solarphp.com
Sat Mar 22 10:11:46 CDT 2008
Solar_AppBase: [CHG] Per suggestion from Antti Holvikari, implement a non-exception _notFound(). Thanks Antti.
Modified: trunk/Solar/AppBase.php
===================================================================
--- trunk/Solar/AppBase.php 2008-03-21 20:08:45 UTC (rev 3035)
+++ trunk/Solar/AppBase.php 2008-03-22 15:11:46 UTC (rev 3036)
@@ -233,6 +233,28 @@
/**
*
+ * Shows the "error" page.
+ *
+ * @param string $action The name of the not-found action.
+ *
+ * @param array $params The params for the not-found action.
+ *
+ * @return void
+ *
+ */
+ public function _notFound($action, $params)
+ {
+ $this->_response->setStatusCode(404);
+ $this->errors[] = $this->locale('ACTION_NOT_FOUND');
+ $this->errors[] = "Action: $action";
+ foreach ($params as $key => $val) {
+ $this->errors[] = "Param $key: $val";
+ }
+ return $this->_forward('error');
+ }
+
+ /**
+ *
* Shows the "exception during fetch" page.
*
* @param Exception $e The exception encountered during fetch().
Modified: trunk/Solar/Cli/MakeModel.php
===================================================================
--- trunk/Solar/Cli/MakeModel.php 2008-03-21 20:08:45 UTC (rev 3035)
+++ trunk/Solar/Cli/MakeModel.php 2008-03-22 15:11:46 UTC (rev 3036)
@@ -159,7 +159,10 @@
}
// write the record template
- $collection_target = substr($target, 0, -4) . DIRECTORY_SEPARATOR . 'Collection.php';
+ $collection_target = substr($target, 0, -4)
+ . DIRECTORY_SEPARATOR
+ . 'Collection.php';
+
$text = str_replace(
array(':class', ':extends'),
array($class, $this->_extends),
Modified: trunk/Solar/Locale/en_US.php
===================================================================
--- trunk/Solar/Locale/en_US.php 2008-03-21 20:08:45 UTC (rev 3035)
+++ trunk/Solar/Locale/en_US.php 2008-03-22 15:11:46 UTC (rev 3036)
@@ -46,6 +46,7 @@
'ACTION_EDIT' => 'Edit',
'ACTION_ADD' => 'Add',
'ACTION_DELETE' => 'Delete',
+ 'ACTION_NOT_FOUND' => 'Not Found',
// exception error messages
'ERR_CONNECTION_FAILED' => 'Connection failed.',
More information about the Solar-svn
mailing list