Welcome Guest, Not a member yet? Register   Sign In
Looping and naming functions in a class!?
#1

[eluser]lkoreality[/eluser]
I'm trying to set this up so that when I add a new page to my database, a new function (in a class) is generated. I know that I can loop for each db row but i want to print out a function for each row in my database so each "segment 2" page will be dynamically generated by what's in my database.

I'm very new to ci and this is my first attempt at oop (oh no!)... so far it has been generally easy with the userguide but I'm stuck now. I'm probably doing this the worst possible way but i'm learnin Wink

So I have several "main" pages named as controllers(classes) - in each controller i want to dynamically generate pages according to what's in my database. The main pages will stay the same so I hard coded them. I'm successfully getting the sub navigation to list what is in my database... but I had to add it as a function to my controller manually. I'm hoping there's a way around that.

Thoughts?!

Luke
#2

[eluser]Johan André[/eluser]
Hey!

The way you are describing sounds like you should take a look att the _remap()-functionality.
Search the forum and you'll find plenty of stuff about it!

Good luck!
#3

[eluser]lkoreality[/eluser]
Sweet! That worked! Thanks man Wink




Theme © iAndrew 2016 - Forum software by © MyBB