Builds the internal view path for the route out of
module, controller and action.
i.e. route for /post/show/15 would return
this path: post/show[.$format]


TODO: add path_names support.
423957
public function path(array $params = array())
    {
        $this->build();
        
        $path = [];
        if ($this->_modules)
            $path = $this->_modules;
        $path[] = $this->_controller;
        $path[] = isset($params['action']) ? $params['action'] : $this->_action;
        
        $format = isset($params['format']) ? '.' . $params['format'] : '';
        
        return implode('/', $path) . $format;
    }
303171
protected function getFullViewsPath($viewsDirectory, $routesPrefix)
    {
        $path = !empty($routesPrefix) ? Helpers::getPathWithSlash(str_replace('.', '-', $routesPrefix)) : '';

        if (!empty($viewsDirectory)) {
            $path .= Helpers::getPathWithSlash($viewsDirectory);
        }

        return $path;
    }
1056353
def path(self, args, kw):
        """"""
        params = self._pop_params(args, kw)
        if args or kw:
            raise InvalidArgumentError("Extra parameters (%s, %s) when building path for %s" % (args, kw, self.template))
        return self.build_url(**params)
297472
public function actionView()
    {
        $path = $this->getPublicPath();
        if (preg_match('@^asset[a-zA-Z0-9]{10}/.*$@', $path)) {
            $path = '/'.substr($path, 16);
        }
        $realPath = \Staq::App()->getFilePath('/public' . $path);
        if (
            empty($realPath) ||
            is_dir($realPath) ||
            \UString::isEndWith($realPath, '.php') /* TODO: Add to settings */
        ) {
            return NULL;
        }
        $this->renderStaticFile($realPath);
        return TRUE;
    }
1040174
def route(view, endpoint=None, methods=None, defaults=None, **options):
    
    if not endpoint:
        endpoint = view
    if not methods:
        methods = ['GET']
    return dict(
        view_func=LazyView(view),
        endpoint=endpoint,
        methods=methods,
        defaults=defaults,
        **options
    )
562251
private function generateView()
    {
        // Figure out the naming
        $path = 'resources/views/admin/'
            . Str::plural(Str::snake($this->argument('model')))
            . '/edit.haml';
        $file = base_path().'/'.$path;

        // Copy the stub over
        if (!file_exists(dirname($file))) {
            mkdir(dirname($file), 0744, true);
        }
        if (file_exists($file)) {
            return $this->comment('View already exists: '.$path);
        }
        copy($this->stubs.'/view.stub', $file);
        $this->info('View created: '.$path);
    }
489877
def find_route_by_view_name(self, view_name, name=None):
        
        if not view_name:
            return (None, None)

        if view_name == "static" or view_name.endswith(".static"):
            return self.routes_static_files.get(name, (None, None))

        return self.routes_names.get(view_name, (None, None))
372819
final public function getOutput($module, $controller, $action, array $params = array(), $partial = true) {
        $view = new View();
        $controllerClass = ucfirst(\Util::hyphenToCamel($module)) . '\Controllers\\' . ucfirst(\Util::hyphenToCamel($controller)) . 'Controller';
        $controllerClass = new $controllerClass;
        $controllerClass->setView($view);
        $action = lcfirst(\Util::hyphenToCamel($action));
        $view->setController($controllerClass)
                ->setAction(lcfirst(\Util::hyphenToCamel($action)))
                ->setModule(ucfirst(\Util::hyphenToCamel($module)));
        $actionRet = call_user_func_array(array($controllerClass, $action . 'Action'), $params);
        if (is_object($actionRet) && is_a($actionRet, 'DScribe\View\View')) {
            $view = $actionRet;
        }
        else {
            $view->variables(($actionRet) ? $actionRet : array());
        }
        if ($viewFile = $view->getViewFile(false)) {
            if (!isset($viewFile[0]) && !isset($viewFile[1])) {
                $view->file($module, $controller, $viewFile[2]);
            }
            else if (!isset($viewFile[0])) {
                $view->file($module, $viewFile[1], $viewFile[2]);
            }
        }
        else {
            $view->file($module, $controller, $action);
        }

        if ($partial) {
            $view->partial();
        }

        ob_start();
        $view->render();
        return ob_get_clean();
    }
341290
def path_helper(self, path, view, **kwargs):
        
        super(FlaskRestyPlugin, self).path_helper(
            path=path,
            view=view,
            **kwargs
        )

        resource = self.get_state().views[view]
        rule = self._rules[resource.rule]

        operations = defaultdict(Operation)
        view_instance = view()
        view_instance.spec_declaration(view, operations, self)

        # add path arguments
        parameters = []
        for arg in rule.arguments:
            parameters.append({
                'name': arg,
                'in': 'path',
                'required': True,
                'type': 'string',
            })
        if parameters:
            operations['parameters'] = parameters

        path.path = FlaskPlugin.flaskpath2openapi(resource.rule)
        path.operations = dict(**operations)
428536
protected function initialRedirectUrl() {

        $defaultUrl = '/'. $this->controller->id . '/' . $this->controller->defaultAction;

        if (isset($this->controller->module->id) && !$this->controller->module instanceof Application) {
            $defaultUrl = '/' . $this->controller->module->id . $defaultUrl;
        }

        if ( empty( $this->successUrl ) ) {
            $this->successUrl = $defaultUrl;
        }

        if ( empty( $this->failedUrl ) ) {
            $this->failedUrl = $defaultUrl;
        }

    }
1085669
function route($path = '/', array $actions = [], $method = Router::ANY_METHOD, $name = '')
    {
        $this->path($path);
        $this->actions[$method] = $actions;
        $this->name = $name;

        return $this;
    }
563551
def render_with_scope(scope = nil, action = self.action_name, path = self.controller_path)
        templates = [ [path, action] ]
        templates << [path, scope, action] if scope
        
        if Sunrise::Config.scoped_views?
          templates << [path, abstract_model.plural, scope, action]
        end
        
        templates.reverse.each do |keys|
          name = File.join(*keys.compact.map(&:to_s))
          return render(:template => name) if template_exists?(name)
        end
      end
131203
def _add_url_route(self, endpoint, rule, view_func, method):
        
        if self.api_prefix:
            rule = self.api_prefix + rule

        if self.endpoint_prefix:
            endpoint = self.endpoint_prefix + endpoint

        self.app.add_url_rule(
            rule,
            endpoint,
            self._apply_auth(view_func),
            methods=[method]
        )
375240
public function getModulesPath()
    {
        $paths = $this->locator->getModulesPath();
        foreach (array_keys($paths) as $module) {
            $paths[$module] .= DIRECTORY_SEPARATOR . TemplateReference::MODULE_VIEWS_DIRECTORY;
        }

        return $paths;
    }
1219084
public function getModuleLayoutViewPath()
    {
        if ($this->module->useAppViewPath) {
            return '@app/views/'.$this->module->id.'/';
        }
        
        return '@'.$this->module->id.'/views/';
    }
1130899
def view_for(self, action='view'):
        
        app = current_app._get_current_object()
        view, attr = self.view_for_endpoints[app][action]
        return getattr(view(self), attr)
324058
public function getPath()
    {
        $controller = str_replace('\\', '/', $this->get('controller'));

        $path = (empty($controller) ? '' : $controller . '/') . $this->get('name') . '.' . $this->get('format') . '.' . $this->get('engine');

        return empty($this->parameters['module']) ?
            self::APP_VIEWS_DIRECTORY . '/' . $path : '@' . $this->get('module') . '/' . self::MODULE_VIEWS_DIRECTORY . '/' . $path;
    }