Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SOLVED Plugin dev. routing
#12
(2016-09-07, 04:22:53)Bigin Wrote: Create new route: galleries/([a-z0-9-/]+) in gs-front-router, for example

Action:



Code:
<?php
return array( 'title' => 'My Title',
  'content' => function($slug) {
  echo 'This is my Gallery' .$slug;

});
that should do the trick.

http://mysite/galleries/abc/
http://mysite/galleries/def/

everything working

Thanks Bigin, it start working I got The Title but the content is empty and when I try  'title' => 'My Title'.$slug,
I got only My Title, And of course I need this $slug 
here is my action code

PHP Code:
<?php
$slug
=$args[0];
return array( 
'title' => 'My Title '.$slug,  // works ;)))
 
  'content' => function($slug) { // doesn't work ?????
 
echo 'test '.$slug;

}); 



Thanks in advance to both of you guys
Reply


Messages In This Thread
Plugin dev. routing - by mica - 2016-09-06, 22:24:52
RE: Plugin dev. routing - by shawn_a - 2016-09-06, 23:48:31
RE: Plugin dev. routing - by mica - 2016-09-06, 23:59:46
RE: Plugin dev. routing - by shawn_a - 2016-09-07, 00:38:00
RE: Plugin dev. routing - by mica - 2016-09-07, 00:42:01
RE: Plugin dev. routing - by shawn_a - 2016-09-07, 01:09:59
RE: Plugin dev. routing - by mica - 2016-09-07, 03:29:33
RE: Plugin dev. routing - by shawn_a - 2016-09-07, 03:58:57
RE: Plugin dev. routing - by shawn_a - 2016-09-07, 04:11:57
RE: Plugin dev. routing - by Bigin - 2016-09-07, 04:22:53
RE: Plugin dev. routing - by mica - 2016-09-07, 05:06:49
RE: Plugin dev. routing - by shawn_a - 2016-09-07, 04:49:15
RE: Plugin dev. routing - by mica - 2016-09-07, 05:13:47
RE: Plugin dev. routing - by Bigin - 2016-09-07, 05:20:28
RE: Plugin dev. routing - by mica - 2016-09-07, 05:24:33
RE: Plugin dev. routing - by Bigin - 2016-09-07, 05:28:37
RE: Plugin dev. routing - by mica - 2016-09-07, 05:31:42
RE: Plugin dev. routing - by Bigin - 2016-09-07, 05:47:00
RE: Plugin dev. routing - by Bigin - 2016-09-07, 06:03:02
RE: Plugin dev. routing - by mica - 2016-09-07, 06:22:26
RE: Plugin dev. routing - by shawn_a - 2016-09-07, 07:04:57



Users browsing this thread: 2 Guest(s)