Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SOLVED Plugin dev. routing
#21
Not sure why he is using a callback for content, there, very confusing.
Plugin is also setting data_index after all the globals are set so it is pretty much useless.


If you want to set all your variables you need to set globals, you can also just echo your content, since the plugin is also doing a ob_get_contents ( it looks like you can match a bunch of routes and it aggregates all the content togather ) but this does not actually work atm, because he is only using data_index->content not global $content..

I honestly have no idea how the above code even works, it only works because of references which is bad.

so as long as you understand these problems it works well.

personally id stick with the globals.


PHP Code:
<?php

GLOBAL $title,$content;
$title   "MY TITLE";
$content "MY CONTENT";

?>
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
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: 1 Guest(s)