Skip to content

Commit 89577a4

Browse files
committed
Improving weak mode detection
1 parent 0b369e1 commit 89577a4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Mouf/Mvc/Splash/Controllers/Controller.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ public function getUrlsList($instanceName)
9494
if ($refMethod->hasAnnotation('Action')) {
9595
$methodName = $refMethod->getName();
9696
if ($methodName == 'index' || $methodName == 'defaultAction') {
97-
$url = $moufManager->findInstanceName($this).'/';
97+
$url = $instanceName.'/';
9898
} else {
99-
$url = $moufManager->findInstanceName($this).'/'.$methodName;
99+
$url = $instanceName.'/'.$methodName;
100100
}
101101
$parameters = SplashUtils::mapParameters($refMethod);
102102
$filters = FilterUtils::getFilters($refMethod, $this);
103-
$urlsList[] = new SplashRoute($url, $moufManager->findInstanceName($this), $refMethod->getName(), $title, $refMethod->getDocCommentWithoutAnnotations(), $refMethod->getDocComment(), $this->getSupportedHttpMethods($refMethod), $parameters, $filters);
103+
$urlsList[] = new SplashRoute($url, $instanceName, $refMethod->getName(), $title, $refMethod->getDocCommentWithoutAnnotations(), $refMethod->getDocComment(), $this->getSupportedHttpMethods($refMethod), $parameters, $filters);
104104
}
105105

106106
// Now, let's check the "URL" annotation (note: we support multiple URL annotations for the same method)

src/Mouf/Mvc/Splash/Services/SplashUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public static function buildControllerResponse($callback, $mode = self::MODE_STR
146146
}
147147
$html = ob_get_clean();
148148

149-
if (!empty($html)) {
149+
if (!empty($html) || $mode === self::MODE_WEAK) {
150150
if ($mode === self::MODE_WEAK) {
151151
$code = http_response_code();
152152
$headers = self::getResponseHeaders();

0 commit comments

Comments
 (0)