Help with planning a CI project |
[eluser]theprodigy[/eluser]
not a problem. I do what I can to help. If you return too soon, I may not be here, as I am heading off to the land of pillows and blankets. Good luck with your project
[eluser]invision[/eluser]
Hehe, I'm heading to the land of goalposts and penalties. Football Thanks again
[eluser]invision[/eluser]
Hi theprodigy, Me again I just have a quick question. In my News page, I'm wanting to list News entries taken from the news sql table. Which then links to their respective news items. How would you suggest I do this? Is there a simple way to visit: www.site.com/index.php/page/news and it would list my news items? Each with a link to view more of the news item? I mean, would my news function in my MPages Model have to retrieve data from a function in my MNews Model? I think it's just a bit of work to my pages/news controller. Sorry, if it's a bit confusing. Thanks again for any help you can give.
[eluser]invision[/eluser]
I have a follow-up query if this is ok. In my /aboutus/ section I have a page called Profile. So the URL is /aboutus/profile/. I'd like to display results from a specfic MySQL table on this page. How could I single out the Profile page so only it shows the MySQL results? Here is my current Controller: Code: class Page extends Controller { Many thanks for any help you can give.
[eluser]invision[/eluser]
That's ok. The main problem is that it checks if it's aboutus or has that slug. And if so, it uses the pages function. I just want it to do something a little different to the pages function for this particular page.
[eluser]Ivar89[/eluser]
if this: Code: $data['page_data'] = $this->MPages->getPageBySlug($slug); Code: <?php foreach($page_data as $data): ?> this is the list, now what I did was make a edit page and just load a ID in it to see more of the page/news item. also; Code: $this->load->vars($data); Code: $this->load->view('template', $data); hope I helped ^^
[eluser]invision[/eluser]
Thanks for the reply. I'm using the following code: Code: <?php But keep getting this error: Code: A PHP Error was encountered Is this because $posts isn't storing any data?
[eluser]invision[/eluser]
Yep. Seems to be the case that $posts isn't getting the data. I've tried just making $posts['id'] = '1'; and it displays a table. I'm assuming this is where the problem lies: Code: $data['posts'] = $this->MPdfs->getAllPdfs();
[eluser]Ivar89[/eluser]
Not necessarily you can check if it is empty or not with the adding this code to your controller: Code: echo var_dump($posts); Mostly (atleast with me) when I see error about undefined var in my view is because it simply does not know what it is or does or store so either a typo or not correctly defined in your controller. |
Welcome Guest, Not a member yet? Register Sign In |