CodeIgniter Forums
Help with planning a CI project - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Help with planning a CI project (/showthread.php?tid=27995)

Pages: 1 2 3 4 5 6


Help with planning a CI project - El Forum - 02-28-2010

[eluser]theprodigy[/eluser]
Quote:echo auto_typography($post_data['title']);
echo auto_typography($post_data['body']);
shouldn't that be
Code:
echo auto_typography($title);
echo auto_typography($body);



Help with planning a CI project - El Forum - 02-28-2010

[eluser]theprodigy[/eluser]
oh wait, never mind.

Change that to

echo auto_typography($page_data['title']);
echo auto_typography($page_data['body']);


Help with planning a CI project - El Forum - 02-28-2010

[eluser]invision[/eluser]
Thanks again.

That's removed the first error, but it now doesn't recognise 'title' or 'body'.

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined index: title

Filename: controllers/page.php

Line Number: 23

and

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: body

Filename: views/public_page.php

Line Number: 3


Thanks again for the help


Help with planning a CI project - El Forum - 02-28-2010

[eluser]invision[/eluser]
Hmm, even with that change, I still seem to be getting the errors.

Could it be with my SQL table?


Help with planning a CI project - El Forum - 02-28-2010

[eluser]theprodigy[/eluser]
right after you call your model function
Code:
$data['page_data'] = $this->MPages->getPageBySlug($slug);
put in 2 debug lines
Code:
echo $this->db->last_query();
print_r($data['page_data']);

and paste the output here


Help with planning a CI project - El Forum - 02-28-2010

[eluser]invision[/eluser]
Code:
SELECT * FROM (`pages`) WHERE `slug` = '$2' LIMIT 1Array ( )

Thanks again for the help.


Help with planning a CI project - El Forum - 02-28-2010

[eluser]theprodigy[/eluser]
show me your routes.php setup


Help with planning a CI project - El Forum - 02-28-2010

[eluser]invision[/eluser]
Code:
$route['default_controller'] = "page";
$route['page/:any/:any'] = "page/pages/$2";
$route['scaffolding_trigger'] = "";



Help with planning a CI project - El Forum - 02-28-2010

[eluser]theprodigy[/eluser]
try putting parenthesis around the any statements:
$route['page/(:any)/(:any)'] = "page/pages/$2";


Help with planning a CI project - El Forum - 02-28-2010

[eluser]invision[/eluser]
Woo-hoooooo!

Thanks theprodigy, it's working Big Grin

And just to be super super annoying.

If I wanted to have a page which was just aboutus/ what would I do?

This would be the main About Us page, before you get into Location etc.