Static Pages |
(07-09-2015, 09:46 AM)Dracula Wrote:(07-09-2015, 09:35 AM)christaliise Wrote:(07-09-2015, 02:45 AM)Dracula Wrote:(07-09-2015, 02:27 AM)christaliise Wrote:(07-08-2015, 12:50 PM)Dracula Wrote: You have to create a controller in application/controllers directory. I don't know where or what is the "root" but I found one at - application/.htaccess And I replaced it with the content you provided, but still get the XAMPP "Welcome Page" coming up in my browser. There is another at - system/.htaccess - but I have not tried to replace the contents. ********** Dracula, can you please explain where I should find the "root" and if not found, where to create .htaccess file? ********** This is the URL I'm using; http://localhost/MyProject/index.php/pages/view I have created a .htaccess file in C:/xampp/htdocs/MyProject/.htaccess and in C:/xampp/htdocs/.htaccess but now I have deleted it. If I include public function__construct() { } in Pages.php I get the following result; Parse error: syntax error, unexpected 'function__construct' (T_STRING), expecting variable (T_VARIABLE) in C:\xampp\htdocs\MyProject\application\controllers\Pages.php on line 4 A PHP Error was encountered Severity: Parsing Error Message: syntax error, unexpected 'function__construct' (T_STRING), expecting variable (T_VARIABLE) Filename: controllers/Pages.php Line Number: 4 Backtrace: *********** If I delete public function__construct() { } from Pages.php I get the following result; Home public function view($page = 'home') { if ( ! file_exists(APPPATH.'/views/pages/'.$page.'.php')) { // Whoops, we don't have a page for that! show_404(); } $data['title'] = ucfirst($page); // Capitalize the first letter $this->load->view('templates/header', $data); $this->load->view('pages/'.$page, $data); $this->load->view('templates/footer', $data); } “Hello World!”© 2014 Can somebody explain where I'm going wrong? *********** I note in the News Section that there is a space between the "n" and "__" public function __construct() and don't know which is correct. *********** 14/07/2015 I would like to know what is causing the following error; Home public function view($page = 'home') { if ( ! file_exists(APPPATH.'/views/pages/'.$page.'.php')) { // Whoops, we don't have a page for that! show_404(); } $data['title'] = ucfirst($page); // Capitalize the first letter $this->load->view('templates/header', $data); $this->load->view('pages/'.$page, $data); $this->load->view('templates/footer', $data); } “Hello World!”© 2014 Can anybody help? |
Messages In This Thread |
Static Pages - by christaliise - 07-08-2015, 09:55 AM
RE: Static Pages - by Dracula - 07-08-2015, 12:50 PM
RE: Static Pages - by christaliise - 07-09-2015, 02:27 AM
RE: Static Pages - by Dracula - 07-09-2015, 02:45 AM
RE: Static Pages - by christaliise - 07-09-2015, 09:35 AM
RE: Static Pages - by Dracula - 07-09-2015, 09:46 AM
RE: Static Pages - by christaliise - 07-09-2015, 06:31 PM
RE: Static Pages - by christaliise - 07-17-2015, 08:46 AM
|