URL Routing
Permalink
Basically, I want a url to route to a controller actions. For example,http://www.example.com/blah/ is an actually page, by I would likewww.www.example.com/blah/blah1/... to automatically be routing to the controller. Most likely blah1 will be a 4 digit number which will be the id for some data in a database.
how about:
http://www.concrete5.org/marketplace/addons/url-director/...
I wrote this for this in mind.
http://www.concrete5.org/marketplace/addons/url-director/...
I wrote this for this in mind.
I was able to figure it out, thank you both.
Hello Reese,
How did you figure it out? I'm trying to do the same thing with Backbone.
Thank you in advance.
How did you figure it out? I'm trying to do the same thing with Backbone.
Thank you in advance.
You can do this with a controller. You can have a controller for a "single_page" or for a regular page that is added by the user.
For a single_page, the controller would be in /controllers/your-page-handle.php
For a user-created page, you need a controller for a specific page type. Let's say you have a pagetype with the handle "blog_post", then you would create this folder:
/controllers/page_types/
...and inside that folder put a file called "blog_post.php". Inside that file would be something like this:
If this is a "single_page", check out this boilerplate code I have for dashboard CRUD interfaces:https://github.com/jordanlev/c5_boilerplate_crud...
Hope that helps!
-Jordan
For a single_page, the controller would be in /controllers/your-page-handle.php
For a user-created page, you need a controller for a specific page type. Let's say you have a pagetype with the handle "blog_post", then you would create this folder:
/controllers/page_types/
...and inside that folder put a file called "blog_post.php". Inside that file would be something like this:
<?php defined('C5_EXECUTE') or die("Access Denied."); class BlogPostPageTypeController extends Controller { public function view($first_querystring_arg = null, $second_querystring_arg = null) { //do something here with the querystring args, then send data to the page type template via $this->set('variable_name', $value); } }
If this is a "single_page", check out this boilerplate code I have for dashboard CRUD interfaces:https://github.com/jordanlev/c5_boilerplate_crud...
Hope that helps!
-Jordan
Dear Jordan,
Thank you for your help, but, what do you mean with single_page and
user-created
page? what's the difference between them?
Thank you
----------------------------------------------
Atentamente/Best regards
Rafael Mora
Cel/Mob: +58-414-493.31.39
BB Pin: 79F583A5
Twitter @titanve. I'm also on Telegram and Whatsapp
Thank you for your help, but, what do you mean with single_page and
user-created
page? what's the difference between them?
Thank you
----------------------------------------------
Atentamente/Best regards
Rafael Mora
Cel/Mob: +58-414-493.31.39
BB Pin: 79F583A5
Twitter @titanve. I'm also on Telegram and Whatsapp
Thank for your help. I will try what you suggest.
Best regards
----------------------------------------------
Atentamente/Best regards
Rafael Mora
Cel/Mob: +58-414-493.31.39
BB Pin: 79F583A5
Twitter @titanve. I'm also on Telegram and Whatsapp
Best regards
----------------------------------------------
Atentamente/Best regards
Rafael Mora
Cel/Mob: +58-414-493.31.39
BB Pin: 79F583A5
Twitter @titanve. I'm also on Telegram and Whatsapp
A fairly roundabout way, but I'm not if what you want to do is possible.
Job.