codeigniter-routing

CodeIgniter: adding parameters to URL

ぐ巨炮叔叔 提交于 2019-12-01 04:40:15
问题 Started my first CI project and am just wondering how I handle URL parameters? I have a controller named 'city', and I've modified my mod_rewrite so localhost/codeigniter uses rewrite to localhost/codeigniter/city. What I want to do is add a city name onto the end of the URL and use get segment to query a table. So my example would be localhost/codeigniter/edinburgh. I would grab the last segment and then create the sql query. However I think when I put edinburgh into the URL CI thinks I'm

Routes in Codeigniter - 404 Page Not Found

為{幸葍}努か 提交于 2019-12-01 04:14:52
问题 Can someone tell me, where the issue is ?? This is my controller class Support extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('support_model'); $urlarray = array("index","delete"); if(!in_array($this->uri->segment(2),$urlarray)){ $this->viewticket($this->uri->segment(2)); } } public function viewticket($id){ if(!empty($id)){ $this->load->view('templates/logged_header'); $this->load->view('support/view'); $this->load->view('templates/footer');

Debugging routes in codeigniter?

此生再无相见时 提交于 2019-11-30 20:13:14
I am wondering if there is any simple way of debugging routes in code igniter? preferably I would like to be able to see in the log along the lines of: Client sent : apps/something Route found : apps/(:any) --> applications/searchbyname/$1 Redirecting : apps/something --> applications/searchbyname/something //and just cause we can lets make the searchbyname function not exist ERROR - 2012-09-16 22:10:05 --> 404 Page Not Found --> applications/searchbyname/something Basically it means we can see when we hit a route and where it is trying to load. Is there any way to enable something along these

Debugging routes in codeigniter?

江枫思渺然 提交于 2019-11-30 16:57:26
问题 I am wondering if there is any simple way of debugging routes in code igniter? preferably I would like to be able to see in the log along the lines of: Client sent : apps/something Route found : apps/(:any) --> applications/searchbyname/$1 Redirecting : apps/something --> applications/searchbyname/something //and just cause we can lets make the searchbyname function not exist ERROR - 2012-09-16 22:10:05 --> 404 Page Not Found --> applications/searchbyname/something Basically it means we can

How to organize country/state/city browsing in codeigniter url

孤者浪人 提交于 2019-11-30 09:44:14
问题 I'm creating a website that includes a country/state/city browsing interface. For SEO purposes, I want to include the name of the country/state/city in the URL. For example, the URL may include additional variables and would be something like: http://www.domain.com/USA/NewYork?Category=car&color=black&Model=2009&page=5 http://www.domain.com/Spain/Allcity?Category=car&color=black&Model=2009&page=20 I need to fit this functionality into CodeIgniter. I'm not sure how to organize the major

Removing index.php in CodeIgniter using .htaccess file

爷,独闯天下 提交于 2019-11-29 00:19:38
I'm currently developing a website using CodeIgniter and I recently stumbled upon a routing & .htaccess problem. Basically, the structure of my simple website (let's call my project 'CIExample' for the sake of simplicity) is as follow: -Home -About Us -Our Service -News -Contact Us which I implemented using a Page controller. This controller has 5 functions which called respective page's view, i.e: Home(), which calls the view 'Home' About(), which calls the view 'About Us' and so on.. Previously, to access 'Home', I would need to type http://localhost/CIExample/index.php/page/home into the

Codeigniter Setting Homepage ( Default Controller )

╄→гoц情女王★ 提交于 2019-11-28 11:16:49
I'm trying to implement page templating in my codeigniter application, templating is working fine for instance, i have a blog page, which i'm trying to assign as my homepage, with different view and pagination and so on. When i write www.mywebsite.com/blog, it gets opened in homepage template, or assume that i have a page www.mywebsite.com/about , it gets opened in page template too. But when i try to access my website via www.mywebsite.com, i have a 404 error page. How can i assign my blog page as the homepage ? Page Controller : class Page extends Frontend_Controller { public function _

Removing index.php in CodeIgniter using .htaccess file

瘦欲@ 提交于 2019-11-27 15:15:36
问题 I'm currently developing a website using CodeIgniter and I recently stumbled upon a routing & .htaccess problem. Basically, the structure of my simple website (let's call my project 'CIExample' for the sake of simplicity) is as follow: -Home -About Us -Our Service -News -Contact Us which I implemented using a Page controller. This controller has 5 functions which called respective page's view, i.e: Home(), which calls the view 'Home' About(), which calls the view 'About Us' and so on..

Codeigniter Setting Homepage ( Default Controller )

自作多情 提交于 2019-11-27 06:12:19
问题 I'm trying to implement page templating in my codeigniter application, templating is working fine for instance, i have a blog page, which i'm trying to assign as my homepage, with different view and pagination and so on. When i write www.mywebsite.com/blog, it gets opened in homepage template, or assume that i have a page www.mywebsite.com/about , it gets opened in page template too. But when i try to access my website via www.mywebsite.com, i have a 404 error page. How can i assign my blog