I have an interesting problem. I currently have a basic template library that renders out a bunch of modules for header and footer templates, then sandwiches a view I specify in between them.
Example:
$this->load->view('header.php', $headerstuff);
$this->load->view($contentView);
$this->load->view('footer.php', $footerstuff);
The problem is that I need to put some javascript (that is specific to each content view) into the header. I have been doing this with a switch statement containing the js inside the template library. But that makes no sense in the mvc model.
Example (of what I've been doing), (in template library, above previous code):
$headerstuff['js'] = '';
switch ($contentView)
{
case 'main':
$headerstuff['js'] = 'JAVASCRIPT INCLUDE CODE 1';
break;
case 'product':
$headerstuff['js'] = 'JAVASCRIPT INCLUDE CODE 2';
break;
}
I can't think of another way to do this though. I would like to (ideally) store the js in a variable inside the content view file, and (somehow) load that into the header view. To be honest though, I don't even think that is possible.
Does anybody have a better way of doing this then my current solution?
Thanks,
Max
I created a helper file to do this for my sites and I think we have a similar MVC template layout:
Asset Helper:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if ( ! function_exists('css'))
{
function css($array) {
// If the object passed is a string, convert it into an array
if ( is_string($array) ) {
$array = explode(" ", $array);
}
// Add additional CSS Files
if ( isset($array) ) {
foreach ( $array as $i => $file ) {
// If it's not the first one add a tab character.
if ( $i > 0 ) echo "\t";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"". $file ."\">\n";
}
}
}
}
if ( ! function_exists('js'))
{
function js($array) {
// If the object passed is a string, convert it into an array
if ( is_string($array) ) {
$array = explode(" ", $array);
}
// Add additional JavaScript Files
if ( isset($array) ) {
foreach ( $array as $i => $file ) {
// If it's not the first one add a tab character.
if ( $i > 0 ) echo "\t";
echo "<script src=\"". $file ."\"></script>\n";
}
}
}
}
This does one of two things. I will allow you to add files in the controller file which is nice. I do this by creating a data object:
$data['css'] = array('/path/to/styles.css', '/path/to/otherstuff.css');
$data['js'] = array('/path/to/javascript.js');
Then in your header include do the following:
<?
$defaultCSS = array("/assets/css/global.css");
$css = (isset($css)) ? array_merge($defaultCSS, $css) : $defaultCSS;
css($css);
$defaultJS = array("/assets/js/global.js");
$js = (isset($js)) ? array_merge($defaultJS, $js) : $defaultJS;
js($js);
?>
I'm settings some defaults that will load on each page and then I can add in different files based on which controller I'm loading.
Hope this helps.
How about having a scripts controller which acts as a small proxy:
/**
* A basic controller which allows for the display of basic views.
*/
class Scripts extends CI_Controller
{
public function _remap( $meth, array $params )
{
// ensure that parent directory contents can't be revealed.
if( !$meth || strpos( $meth, '.' ) !== FALSE ) show_404();
foreach( $params as $arg )
// I put all css in a folder called css all js goes into
// a folder called js. It can be overly simple, but it works
// (if you need these files to be php files, just add '.php'
// to the end of the FILE's name. No need to worry about that
// here, CodeIgniter's got your back...)
$this->load->view( "$meth/${params}.$meth" );
}
}
How to use:
For each controller (or, you could easily modify this to be for every method), have an appropriate js file in your views/js folder. Name each after the respective controller. Then, point to each of them from the view:
Then, in the header view:
<script type="text/javascript" src="
<?php
// honestly, I normally use a helper function here, but this is the
// short... short version.
echo base_url() . '/scripts/js/' . load_class('Router')->fetch_class();
// You can also replace the controller name with the view name by using the
// variable $_ci_view, you can get the full path with $_ci_path
?>" ></script>
Best part? Your controller is agnostic about the contents of the view. The view is more or less agnostic of the controller (it is a variable populated ahead of time from an external source and just... there). In fact, the only things which "need to know" are the JS/CSS files and they were on a case by case configuration anyway.
Related
I was wandering if it were possible to store a html schema page with special strings to replace with variable and how to do it.
In an external file, I would like to put the html structure of a product, let's call it schema.php:
<span id="{% id %}">{%= name %}</span>
<span>{%= imageURL() %}</span>
The example above is just a simpler example. In the external file, the html would be more complex. I know that if there were just few lines I could just echo them with a simple function but this is not the case.
In another file I have a class that handle products, let's call it class.php:
class Product {
//logic that is useless to post here.
public function imageURL() {
return "/some/url".$this->id."jpg";
}
}
In this class I would like to add a function that take the content from schema.php and then echo it in the public file for users.
I tried with file_get_contents() and file_put_contents() but it just doesn't work:
$path_to_file = 'data/prodotti/scheda.inc';
$file_contents = file_get_contents($path_to_file);
$file_contents = str_replace(
"{%= ",
"<?php echo $this->",
$file_contents
);
$file_contents = str_replace(
" }",
"; ?>",
$file_contents
);
file_put_contents($path_to_file, $file_contents);
is it possible to call schema.php page and print it with custom variables?
By "schema page" I think you mean "template" and yes, but the best way to do it is to use an existing templating engine such as Smarty or a Mustache implementation like https://github.com/bobthecow/mustache.php instead of implementing it yourself because of the risks of XSS, HTML-injection, and how you'll eventually want features like looping and conditionals.
you can do it normaly with php require func. without any strings to replace, if you just want to use that file as "template" then:
in schema.php:
<?php
echo'<span id="'.$id.'">'.$name.'</span>
<span>'.$imageURL.'</span>';
?>
in class.php:
<?php
class Product {
//logic that is useless to post here.
public function imageURL() {
return "/some/url".$this->id."jpg";
}
}
$imageURL = imageURL(); ?>
Index.php or whatever the main page that handles class.php and temp.php(schema)
<?php
//avoid undefined variables on errors
//in case that you don't check for values submitted
$id = 0;
$name = 0;
$imageURL = '';
//set vars values
$id = /*something*/;
$name = /*something 2*/;
$imageURL = /*something3*/;
//all date will be replaced is ready, oky nothing to wait for
require('path/to/schema.php');
Note: If you gets these data from user, then you should validate with if(isset()).
hope that helps,
Is there any elegant way to check if a file was included by using include/include_once/require/require_once or if the page was actually loaded directly? I'm trying to set up a testing file inside class files while I'm creating them.
I'm looking for something similar to Python's if __name__ == "__main__": technique. Without setting globals or constants.
Quoted from: How to know if php script is called via require_once()?
I was looking for a way to determine if a file have been included or called directly, all from within the file. At some point in my quest I passed through this thread. Checking various other threads on this and other sites and pages from the PHP manual I got enlightened and came up with this piece of code:
if (basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
echo "called directly";
} else {
echo "included/required";
}
In essence it compares if the name of the current file (the one that
could be included) is the same as the file that is beeing executed.
Credit: #Interwebs Cowboy
you can do this by get_included_files — Returns an array with the names of included or required files and validate against __FILE__
I appreciate all the answers, but I didn't want to use any one's solution here, so I combined your ideas and got this:
<?php
// place this at the top of the file
if (count(get_included_files()) == 1) define ('TEST_SUITE', __FILE__);
// now I can even include bootstrap which will include other
// files with similar setups
require_once '../bootstrap.php'
// code ...
class Bar {
...
}
// code ...
if (defined('TEST_SUITE') && TEST_SUITE == __FILE__) {
// run test suite here
}
?>
if (defined('FLAG_FROM_A_PARENT'))
// Works in all scenarios but I personally dislike this
if (__FILE__ == get_included_files()[0])
// Doesn't work with PHP prepend unless calling [1] instead.
if (__FILE__ == $_SERVER['SCRIPT_FILENAME'])
// May break on Windows due to mixed DIRECTORY_SEPARATOR
if (basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME']))
// Doesn't work with files with the same basename but different paths
if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME']))
// Seems to do the trick as long as document root is properly configured
Note: On WAMP Servers virtual-hosts sometimes inherit the default document root setting, causing $_SERVER['DOCUMENT_ROOT'] to display wrong path.
<?php
if (__FILE__ == $_SERVER['SCRIPT_FILENAME'])
{
//file was navigated to directly
}
?>
Taken from mgutt's answer to a slightly different question here. It's important to note this doesn't work if the script is run from command line but other than that it functions exactly like python's
if __name__ == '__main__':
as far as I can tell
They is no way to separate them as include/include_once/require/require_once but php has get_included_files and get_required_files which is the same thing and only returns array of all included files. Its does not separate it if its required or included.
Example a.php
include 'b.php';
include_once 'c.php';
require 'd.php';
var_dump(get_required_files());
Output
array
0 => string '..\lab\stockoverflow\a.php' (length=46) <---- Returns current file
1 => string '..\lab\stockoverflow\b.php' (length=46)
2 => string '..\lab\stockoverflow\c.php' (length=46)
3 => string '..\lab\stockoverflow\d.php' (length=46)
But you can do something like
$inc = new IncludeManager($file);
var_dump($inc->find("b.php")); // Check if a file is included
var_dump($inc->getFiles("require_once")); // Get All Required Once
Class Used
class IncludeManager {
private $list = array();
private $tokens = array();
private $find;
private $file;
private $type = array(262 => "include",261 => "include_once",259 => "reguire",258 => "require_once");
function __construct($file) {
$this->file = $file;
$this->_parse();
}
private function _parse() {
$tokens = token_get_all(file_get_contents($this->file));
for($i = 0; $i < count($tokens); $i ++) {
if (count($tokens[$i]) == 3) {
if (array_key_exists($tokens[$i][0], $this->type)) {
$f = $tokens[$i + 1][0] == 371 ? $tokens[$i + 2][1] : $tokens[$i + 1][1];
$this->list[] = array("pos" => $i,"type" => $this->type[$tokens[$i][0]],"file" => trim($f, "\"\'"));
}
}
}
}
public function find($find) {
$finds = array_filter($this->list, function ($v) use($find) {
return $v['file'] == $find;
});
return empty($finds) ? false : $finds;
}
public function getList() {
return $this->list;
}
public function getFiles($type = null) {
$finds = array_filter($this->list, function ($v) use($type) {
return is_null($type) ? true : $type == $v['type'];
});
return empty($finds) ? false : $finds;
}
}
get_included_files() return array where 0 index mean first "included" file. Because direct run mean "include" in this terms, you can simple check first index for equality for __FILE__:
if(get_included_files()[0] == __FILE__){
do_stuff();
}
This can not work on PHP 4, because PHP 4 not add run file in this array.
Here's a different idea.
Just include the file whenever you need it.
Inside the include file you can decide whether it needs to include the contents:
<?php
if (defined("SOME_UNIQUE_IDENTIFIER_FOR_THIS_FILE"))
return;
define("SOME_UNIQUE_IDENTIFIER_FOR_THIS_FILE", 1);
// Rest of code goes here
Working solution:
$target_file = '/home/path/folder/file.php'; // or use __FILE__
if ($x=function($e){return str_replace(array('\\'), '/', $e);}) if(in_array( $x($target_file), array_map( $x , get_included_files() ) ) )
{
exit("Hello, already included !");
}
I don't think get_included_files is the perfect solution, what if your main script included some other scripts before the check? My suggestion is to check whether __FILE__ equals realpath($argv[1]):
<?php
require('phpunit/Autoload.php');
class MyTests extends PHPUnit_Framework_TestCase
{
// blabla...
}
if (__FILE__ == realpath($argv[0])) {
// run tests.
}
I took a similar approach to this issue when I cam across it. The solution I found was to load each file as needed in an include_once method. Hope this helps.
$FILES = get_included_files(); // Retrieves files included as array($FILE)
$FILE = __FILE__; // Set value of current file with absolute path
if(!in_array($FILE, $FILES)){ // Checks if file $FILE is in $FILES
include_once "PATH_TO_FILE"; // Includes file with include_once if $FILE is not found.
}
I have the following function established to check files loaded:
ARRAY_DUMP($FILES);
function ARRAY_DUMP($array){
echo "
<span style='font-size:12px;'>".date('h:i:s').":</span>
<pre style='font-size:12px;'>", print_r($array, 1), "</pre>
";
}
Output:
currentArray
(
[0] => /home/MY_DOMAIN/hardeen/index.php
[1] => /home/MY_DOMAIN/hardeen/core/construct.php
[2] => /home/MY_DOMAIN/hardeen/core/template.php
[3] => /home/MY_DOMAIN/hardeen/bin/tags.php
[4] => /home/MY_DOMAIN/hardeen/bin/systemFunction.php
)
It's sooo simple..
I have made something like this:
//code for file.php
if (!isset($file_included)){
echo "It was loaded!";
} else {
echo "It was included!";
}
//code for loader.php
//proves that atleast loader.php has loaded,
//not the file we targeted first..
$file_included = true;
include("../file.php");
And that's it.. as simple as in python.
Although I don't think the question was as good as it could be, let me try to explain better here.
I have a site using SMARTY 3 as the template system. I have a template structure similar to the below one:
/templates/place1/inner_a.tpl
/templates/place1/inner_b.tpl
/templates/place2/inner_b.tpl
/templates/place2/inner_c.tpl
/templates/default/inner_a.tpl
/templates/default/inner_b.tpl
/templates/default/inner_c.tpl
These are getting included on the parent template using
{include file="{$temp_folder}/{$inner_template}"}
So far great. What I wanted to do is having a default for, in the case that the file {$temp_folder}/{$inner_template} does not exists, it uses the equivalent file at default/{$inner_template}.
i.e. If I do {include file="place1/inner_c.tpl"}, since that file does not exists it in fact includes "default/inner_c.tpl"
Is it possible?
You'll have to do it in php, smarty doesn't have a way to check if a file exists.
You could write your own template handler too.
<?php
// put this function somewhere in your application
function make_template ($resource_type, $resource_name, &$template_source, &$template_timestamp,
&$smarty_obj)
{
if( $resource_type == 'file' ) {
if ( ! is_readable ( $resource_name )) {
// create the template file, return contents.
$template_source = "This is a new template.";
require_once SMARTY_CORE_DIR . 'core.write_file.php';
smarty_core_write_file( array( 'filename'=>$smarty_obj->template_dir . DIRECTORY_SEPARATOR . $resource_name, 'contents'=>$template_source ), $smarty_obj );
return true;
}
} else {
// not a file
return false;
}
}
// set the default handler
$smarty->default_template_handler_func = 'make_template';
?>
What would be the best way to check for the current URI segment in a CodeIgniter view? What I am trying to do is use the current URI segment [i.e. $this->uri->segment(1)] in order to highlight the current page on the navigation bar.
The best that I have figured out is to do
$data['current_uri'] = $this->uri->segment(1);
$this->load->view('header', $data);
in each of my controllers and then in the header.php file, I check the $current_uri variable to determine which part of the navigation should be highlighted. As you know, this is a very tedious way of doing it, but I'm at a loss of a better way to do this.
It may even be possible to extend the default Controller class to pass the current URI segment, but I'm not sure if this would work, or even how to go about doing it.
I myself use an extra function similar to anchor(). I call it active_anchor(), and it takes all the same parameters plus another (the uri). The function then adds the class 'active' if the uri string passed matches the active_anchor() url paramter.
Then the function returns using the anchor function (all that the function did was determine if the link needed the class 'active' or not.
EDIT:
I just put this code in a file called 'MY_url_helper.php'. That way, when the url helper is loaded (I actually auto load that one since pretty much all of my views use it anyway.) This is just some quick code too, pretty sure it would work. Basically it takes the same arguments as the anchor() function, but also the $key variable. It appends a class of "active" to the anchor tag if the key and url match.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if ( ! function_exists('active_anchor'))
{
function active_anchor($url = NULL, $title = NULL, $key = NULL, $params = array())
{
if ($url && $key)
{
if($key == $url)
{
if (array_key_exists ('class' , $params))
{
$params['class'] .= ' active';
}
else
{
$params['class'] = 'active';
}
}
}
return anchor($url, $title, $params);
}
}
Simple way to check the uri segment in view,
Add some code if matches found.
<li class="<?php echo (strcmp($this->uri->segment(2),'test')==0)?'active':''; ?>"><li>
<li class="<?php echo (strcmp($this->uri->segment(2),'test1')==0)?'active':''; ?>"><li>
<li class="<?php echo (strcmp($this->uri->segment(2),'test2')==0)?'active':''; ?>"><li>
I also had the same problem when I was building a customer website in Cakephp, passing those strings for every menu item from controller to view, then checking again in view for implementing the highlighting to tedious to say the least.
For some of my projects now, I have been implementing the same by storing the page information for each of the navigation menu pages in database, things like page name, url, title, position in navigation menu etc.
Then at the start of controller, I store all this data in an array say $pageinfo.
I handle the navigation functionality via a single controller that checks the URI segment and loads the content based on that.
The highlighting part is left to an if statement when generating the view, where I compare each page name to the information I dumped in $pageinfo.
Something like this...
foreach ($navi_menu as $links) {
if ( $links['title'] == $pageinfo['title'] ) {
// Highlight here
}
else {
// No highlight
}
}
This way I don't need to pass the string constants (uri segments in your case) to the view. This CMS-kinda-approach allows me to flexible in adding further items to my menu, without adding more code.
I remember getting this from a codeigniter wiki, can't find the link to it right now.
this simple way and running well for me..
<li class="<?=($this->uri->segment(2)==='test')?'current-menu-item':''?>"><?php echo anchor ('home/index','HOME'); ?></li>
<li class="<?=($this->uri->segment(2)==='blog')?'current-menu-item':''?>"><?php echo anchor ('home/blog','BLOG'); ?></li>
<li class="<?=($this->uri->segment(2)==='bla..bla')?'current-menu-item':''?>"><?php echo anchor ('home/blog','bla..bla'); ?></li>
uri_segment(2) that mean function in ur controller.
but have a weakness, i have trouble if i put view in index controller, so im not use function index ( toruble in uri segment, make 2 current page in same time... read this http://ellislab.com/codeigniter/user-guide/libraries/uri.html
I'll probably get flamed for suggesting a client-side approach, but this is something I've used in the past to mark the current page as highlighted:
var path = location.pathname.substring(1);
if ( path )
$('#navigation a[href$="' + path + '"]').parents('li').attr('class', 'current');
In every CodeIgniter project I gather some basic information about the request in MY_Controller.
I extend the core controller and put in some initialization logic that needs to happen on every page. This includes getting the information about the controller and method, which is passed to the view. As a short example:
class MY_Controller extends CI_Controller
{
protected $_response_type = 'html';
protected $_secure;
protected $_dir;
protected $_controller;
protected $_method;
protected $_template;
protected $_view;
protected $_user;
public function __construct()
{
parent::__construct();
// Gather info about the request
$this->_secure = ! empty($_SERVER['HTTPS']);
$this->_dir = $this->router->fetch_directory();
$this->_controller = $this->router->fetch_class();
$this->_method = $this->router->fetch_method();
// set the default template and view
$this->_template = 'default';
$this->_view = $this->_dir . $this->_controller . '/' . $this->_method;
}
/**
* Performs operations right before data is displayed.
*
* #access public
* #return void
*/
public function _pre_display()
{
if ($this->_response_type === 'html') {
$this->load->vars(array(
'user' => $this->_user
));
}
elseif ($this->_response_type === 'json') {
$this->_template = 'json';
$this->_view = NULL;
}
else {
show_error('Invalid response type.');
}
$this->load->vars(array(
'is_secure' => $this->_secure,
'controller' => $this->_controller,
'method' => $this->_method
));
}
}
Now in a view such as the navigation you can use that information like this:
<a href="<?php echo site_url('products') ?>"<?php echo ($controller === 'products') ? ' class="selected"' : ''; ?>>Products</a>
I like it because with routes or rewrites you may access controllers and methods from different URLs. This way you set whether the link is active based on the controller/method that is serving up the content and not based on the URL.
Also, this information can be reused within your controllers or views for any reason and you are not continually asking the router or uri to calculate the information (which not only is inefficient, but is cumbersome to write over and over).
I'm writing a simple templating layer in PHP but I've got myself a little stuck. Here's how it works at the moment:
Firstly I use fetch_template to load the template contents from the database - this works (and I collect all the templates at startup if you're interested).
I use PHP variables in my template code and in the logic - e.g.:
// PHP:
$name = 'Ross';
// Tpl:
<p>Hello, my name is $name.</p>
I then use output_template (below) to parse through the variables in the template and replace them. Previously I was using template tags with a glorified str_replace template class but it was too inefficient.
/**
* Returns a template after evaluating it
* #param string $template Template contents
* #return string Template output
*/
function output_template($template) {
eval('return "' . $template . '";');
}
My problem, if you haven't already guessed, is that the variables are not declared inside the function - therefore the function can't parse them in $template unless I put them in the global scope - which I'm not sure I want to do. That or have an array of variables as a parameter in the function (which sounds even more tedious but possible).
Does anyone have any solutions other than using the code from the function (it is only a one-liner) in my code, rather than using the function?
Thanks,
Ross
P.s. I know about Smarty and the vast range of templating engines out there - I'm not looking to use them so please don't suggest them. Thanks!
Rather than run through your loop you can use include($template_name).
Or, if you want the content of the output from the template, you can do something like this:
$template_name = 'template.php';
// import the contents into this template
ob_start();
include($template_name);
$content = ob_get_clean();
// do something with $content now ...
And remember, in your template, you can use the often overlooked PHP syntax:
<?php if ($a == 5): ?>
A is equal to 5
<?php endif; ?>
Alternative syntax is available for if, while, for, foreach and switch ... perfect for manipulating the data in your template. See "Alternative syntax for control structures" for more details.
I'd pass an associative array with variables to replace, then extract() them.
Then you could also pass $_GLOBALS to achieve the same result.
function output_template($template, $vars) {
extract($vars);
eval('return "' . $template . '";');
}
Edit: you might also want to consider string subtitution instead of eval, depending on who's allowed to write your templates and on who specifies which template to load. Then there might be a problem with escaping, too...
Also, expanding on davev's comment eval is a bit ugly.
If you can do something like
function inc_scope( $file , $vars )
{
extract($vars);
ob_start();
require($file);
return ob_get_clean();
}
Then you get to use plain-old-php as your templating language, and you don't get any evil-evals, and "extract" + buffering merely limits the visible scope of the php code in the require.
Create file
config.php
index.php
Create folder
inc
template/default/controller/ main files here home.php, login.php, register.php, contact.php, product.php ...
headet.tpl and footer.tpl include home.php file.
main dir /template/default
config.php code here
/* semu design */
// HTTP URL
define('HTTP_SERVER', 'http://localhost/1/');
// HTTPS URL DISABLE
// define('HTTPS_SERVER', 'http://localhost/1/');
// DİZİNLER
define('DIR_INC', 'C:\wamp\www\1/inc/');
define('DIR_TEMLATE', 'C:\wamp\www\1/template/default/');
define('DIR_MODULES', 'C:\wamp\www\1/template/default/module/');
define('DIR_IMAGE', 'C:\wamp\www\1/image/');
define('DIR_CACHE', 'cache'); // [php cache system turkish coder][1]
// DB
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '123');
define('DB_DATABASE', 'default');
define('DB_PREFIX', '');
index.php code here
<?php
// Version
define('VERSION', '1.0');
// Config file
if (file_exists('config.php')) {
require_once('config.php');
}
// Moduller
require_once(DIR_INC . 'startup.php'); // mysql.php db engine, cache.php, functions.php, mail.php ... vs require_once code
// Cache System
//$sCache = new sCache();
/*$options = array(
'time' => 120,
'buffer' => true,
'load' => false,
//'external'=>array('nocache.php','nocache2.php'), // no cache file
);
$sCache = new sCache($options);*/
// page
$page = isset($_GET['page']) ? trim(strtolower($_GET['page'])) : "home";
$allowedPages = array(
'home' => DIR_TEMPLATE.'controller/home.php',
'login' => DIR_TEMPLATE.'controller/login.php',
'register' => DIR_TEMPLATE.'controller/register.php',
'contact' => DIR_TEMPLATE.'controller/contact.php'
);
include( isset($allowedPages[$page]) ? $allowedPages[$page] : $allowedPages["home"] );
?>
index.php?page=home
index.php?page=login ...
Active class code
<ul>
<li <?php if ( $page == 'home' ) echo 'class="active"'; ?> Home </li>
<li <?php if ( $page == 'login' ) echo 'class="active"'; ?> Login </li>
</ul>
And Token system coming :
index.php?page=home&token=Co54wEHHdvUt4QzjEUyMRQOc9N1bJaeS
Regards.