jquery-mobile + codeigniter -
what must problem code:
<!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title><?php echo $title; ?></title> <?php echo link_tag('assets/css/jquery.mobile-1.3.2.min.css', 'stylesheet'); echo script_tag('assets/js/jquery-1.10.2.min.js'); echo script_tag('assets/js/jquery.mobile-1.3.2.min.js'); ?> </head> <body> <div data-role="page"> <header data-role="header"> <a href="#navigation" data-role="button">show</a> <h3><?php echo $title; ?></h3> <div data-role="controlgroup" data-type="horizontal" class="ui-btn-right"> <a href="#" data-role="button">my account</a> <a href="<?php echo site_url();?>login" data-role="button">logout</a> </div> </header>
i'am using jquery mobile client-side script , php(codeigniter) server-side script. when refresh page after including in anchor page doesn't display page anymore.
can tell what's wrong code or i'am missing something.
<?php if ( ! defined('basepath')) exit('no direct script access allowed'); class event_management_c extends ci_controller { public function __construct() { parent::__construct(); $this->load->helper('html', 'url', 'form'); } public function index() { $data['title'] = 'events'; $data['reply_title'] = 'reply message'; $this->load->view('fragments/header', $data); $this->load->view('fragments/nav', $data); $this->load->view('events/index', $data); $this->load->view('fragments/footer', $data); } } ?>
based on answers comments; problem function site_url()
isn't defined. result of fatal error, isn't shown due settings in php concerning error_report
.
to solve this, run $this->load->helper('url')
in relevant controller, or add url
helper array in application/config/autoload.php
. since function common, recommend autoload it.
Comments
Post a Comment