Help with planning a CI project

#21
[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);

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

Change that to

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

#23
[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

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

Could it be with my SQL table?

#25
[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

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

Thanks again for the help.

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

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

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

#30
[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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.