[puntoengine] r107 committed - The Url class when return posibles controllers return Home by default ...

0 views
Skip to first unread message

punto...@googlecode.com

unread,
Nov 7, 2011, 10:30:27 AM11/7/11
to punto...@googlegroups.com
Revision: 107
Author: jba...@gmail.com
Date: Mon Nov 7 07:29:45 2011
Log: The Url class when return posibles controllers return Home by
default controller. Fixed a new template system processor when ~/ is
written can't replace by current base url.
http://code.google.com/p/puntoengine/source/detail?r=107

Modified:
/trunk/puntoengine/core/Kernel.php
/trunk/puntoengine/core/http/Url.php
/trunk/puntoengine/core/http/WebResponse.php

=======================================
--- /trunk/puntoengine/core/http/Url.php Fri Nov 4 17:33:02 2011
+++ /trunk/puntoengine/core/http/Url.php Mon Nov 7 07:29:45 2011
@@ -53,6 +53,9 @@
* @since 0.4.0
*/
public function getControllers() {
+ if(count($this->urlParts) == 1 && $this->urlParts[0] == '') {
+ return array('Home');
+ }
$controllers = array();

for($i = count($this->urlParts) - 1; $i >= 0; $i--) {
@@ -74,3 +77,4 @@
return $controllers;
}//getControllers
}//Url
+?>
=======================================
--- /trunk/puntoengine/core/http/WebResponse.php Sat Nov 5 20:20:14 2011
+++ /trunk/puntoengine/core/http/WebResponse.php Mon Nov 7 07:29:45 2011
@@ -105,6 +105,14 @@
$master = $this->processMasterPage($request, $content);
$content = $master;
}
+
+ $path = Kernel::getVirtualPath();
+
+ if($path == '/') {
+ $path = '';
+ }
+
+ $content = str_replace('~/', $path.'/', $content);

echo $content;
}//process

Reply all
Reply to author
Forward
0 new messages