Creating a module view

edited December 2015 in Modules
Hello,

So I created the projects module from the tutorial, but now I want to create a view for my projects.
I have the following preview_path: /project/{slug}

When I run the url /project I get the correct view, but when I run /project/example-project, the page is not found.
I seems that it is looking for a view file named example-project...
I want it to go to the project view so I can dynamicly load the contents of my example-project inside the project view.
This means it should always go to my project view no matter what is after the project/*
Any idea how to do this?

Comments

  • edited 4:14PM
    Already fixed, seems I had to enable auto_search_views in MY_fuel config
  • Do you have a project controller?

    I'd add a function (maybe function show($project) {} ) that takes the project name off the url and renders it $page_init = array('location'=>'project','render_mode'=>'view'); $this->fuel->pages->render('view_project, $vars, $page_init); where 'view_project' is your view file.

    The url for the project would be ./project/show/example-project (you could use a route to shorten it to ./project/example-project if you needed it that way).
Sign In or Register to comment.