CodeIgniter Forums

Full Version: Create pages .php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Stoppy[/eluser]
Hi!
I am rewriting an old website. This website has a series of .php pages. These pages are well positioned in google and we would like to maintain this pages. So i would like to know if is possible (and how) to use codeigniter models and views to develop them.


Thank you
Peppe

El Forum

[eluser]bubbafoley[/eluser]
you can set the url_suffix config item to append .php to your urls.

http://ellislab.com/codeigniter/user-gui.../urls.html

see the section 'Adding a URL Suffix'

El Forum

[eluser]Stoppy[/eluser]
[quote author="bubbafoley" date="1302910590"]you can set the url_suffix config item to append .php to your urls.

http://ellislab.com/codeigniter/user-gui.../urls.html

see the section 'Adding a URL Suffix'[/quote]

Hi,
maybe I was not so clear.
Condeigniter works MVC model-controller-view

From a controller I call one or more modules then a view and send the output.

I would like to create pages (true files) .php in the server, use them as "controllers" and use there models and views i have in my application/ directory


for example i have

/application
/application/models/mypersonal_model.php
/appucation/views/mypersonal_view.php
/controllers/
/system
index.php

anotherpage.php
anotherdirectory/anotherpagetwo.php


in anotherpage.php i would like to write or use a controller....
Is crazy I know but there is a way?

The first solution i had was to create a standard MVC and inside the page call it using file_get_contents() ... but is an horrible solution!

there is or not a way? what do you think?

Thank you

El Forum

[eluser]bubbafoley[/eluser]
Quote:Condeigniter works MVC model-controller-view

From a controller I call one or more modules then a view and send the output.

I would like to create pages (true files) .php in the server, use them as “controllers” and use there models and views i have in my application/ directory

Your controllers have to go in application/controllers. That's where CI looks for them.

But it can be done with routes. You still have to save your controllers in the controllers directory but you can reroute anotherpage.php to run a controller.

Code:
$route['anotherpage.php'] = 'controller/method';

El Forum

[eluser]Stoppy[/eluser]
Perfect!
The route is the solution i think!
Thank you!