Welcome Guest, Not a member yet? Register   Sign In
Default Layout
#21

[eluser]TheFuzzy0ne[/eluser]
[quote author="Dam1an" date="1244649426"]Is it even possible to have a variable start with a number?[/quote]

No, it results in a parse error.
#22

[eluser]mighty_falcon[/eluser]
Thanks for the replies!

I had tried setting $this->data['popular'] = $popular; but no luck. I ended up just doing away with the hook, still extending MY_Controller but instead just calling $this->render($data);

It's one more line so I am not that fussed about it.
#23

[eluser]beckmann[/eluser]
[quote author="Dam1an" date="1244649426"]Jedd seems to have picked up on the main points (as always)
I would just like to say (disclaimer) this was never meant to be widely used code, it was just a 'hack' I posted to help a user... I've since moved to something more complex, and moved it into a seperate library.
[/quote]

I'm new to CI and so far I am loving these forums. Currently I'm working on a project where we wanted a Default View/some nested views so the Template link and the rest of this thread has been helpful.
I am curious though why this code is just a 'hack'. Would modifications like this usually be discouraged in favor of a different approach(such as the template library)? Just wondering as I start my implementation and get ready to ask real questions about the code from this thread.
#24

[eluser]jedd[/eluser]
[quote author="beckmann" date="1244775813"]
I'm new to CI and so far I am loving these forums.[/quote]

Hi beckmann, and welcome to the forums.

I think 'hack' is used whenever we look back at code that we'd do slightly differently (this week) - or that we modified to fit into a forum message (or just to fit into the current context of whatever was being discussed).

I've noticed that there's usually two very broad directions you can go with most of these things, and ultimately it comes down to which approach you are more comfortable with. The great thing with design - any design, not just IT stuff - is that there's always ways to optimise things - and that, in turn, is the great thing about these forums.




Theme © iAndrew 2016 - Forum software by © MyBB