Welcome Guest, Not a member yet? Register   Sign In
My First CI Page - Hooks to Run Common Code
#11

[eluser]johnwbaxter[/eluser]
England then?
#12

[eluser]purpleparasol[/eluser]
Yes, England.
#13

[eluser]johnwbaxter[/eluser]
Just checking your sense of humour status there.

Do you wish you were an Essex Girl?

I'll admit i am an essex boy, so i do know essex girls fairly well shall we say.

Not 100% sure why anyone would want to name themselves an essex girl if they weren't....
#14

[eluser]purpleparasol[/eluser]
Quote:Just checking your sense of humour status there.
This wasn't lost on me, but I wasn't so sure about everyone else. The subject is a little off-topic.

Quote:Do you wish you were an Essex Girl?
No need to, because I am.

Quote:I’ll admit i am an essex boy, so i do know essex girls fairly well shall we say.
I think we get a bad press.

Quote:Not 100% sure why anyone would want to name themselves an essex girl if they weren’t....
As I said, I am, but like to think I help to broaden and let's say, deepen the definition a bit.
#15

[eluser]johnwbaxter[/eluser]
Yeah it is off topic. Sorry about that.

My sisters are essex girls and i would say they don't fall into the stereotype either. Perhaps it is the part of essex i live in, but they do tend to conform to the stereotype round here.

Just interested twas all.

I'll be quiet now....
#16

[eluser]purpleparasol[/eluser]
Quote:Could be something as simple as a redirect in the constructors of parent controllers. The parent controllers could have checks against values in config.php
I am not sure I understand what you meant by this Rick. Assuming I have not misunderstood you, I was trying to avoid having anything at all in the controllers for the app's forms. The hook is specifically to avoid having to repeat stuff in every constructor . . .
#17

[eluser]Rick Jolly[/eluser]
[quote author="essexgirl" date="1199993050"]
Quote:Could be something as simple as a redirect in the constructors of parent controllers. The parent controllers could have checks against values in config.php
I am not sure I understand what you meant by this Rick. Assuming I have not misunderstood you, I was trying to avoid having anything at all in the controllers for the app's forms. The hook is specifically to avoid having to repeat stuff in every constructor . . .[/quote]
Extending the CI Controller is one way of avoiding code repetition. What you did with the hook could also be done in one place using inheritance. You'd just extend the CI Controller, and put some code in the constructor of that new parent controller (the code would be a redirect to a static page if the site was "closed"). Then instead of all controllers extending the CI controller, they'd extend the new parent controller.

You can go wild with inheritance. You could have a custom parent controller and then have an admin and public parent controller extend it. That is what I was getting at with the example.

I don't like hooks for anything application specific because hooks aren't transparent/traceable.
#18

[eluser]CI Lee[/eluser]
[quote author="John Fuller" date="1199962841"]Tell you what though, that is much prettier than my first CI page. My first CI code was ugly. Think about CI Lee, but shaved. Ugly![/quote]

Nice... wait until I go to bed and lob that volley into the court. I'll have you know that there is no need to shave me as I am already balding at an alarming rate.

However! I am not losing my hair; I keep it in a bag under my bed.


-Lee
#19

[eluser]pims[/eluser]
I'd go the .htaccess way. redirect all your visitors to a "maintenance page" and once you're done tweaking your app, comment the line in your .htaccess




Theme © iAndrew 2016 - Forum software by © MyBB