-
Notifications
You must be signed in to change notification settings - Fork 341
Hide call and online/offline when no application_sid present #231
base: develop
Are you sure you want to change the base?
Conversation
Instead of doing the nested if statements in the template can you instead define a single var of "can_enable_client" (or something better, yes, definitely figure out a better name than that ;) ) in the controller and simply reference that variable in the template? Alternately you could define a new helper function in the twilio_helpers that would do this logic and returns a boolean. It'd be a lot cleaner and reusable. |
I like the helper option over the controller var option. I'll try that one. Is there a particular global variable that I should be utilizing? I'm not entirely certain what $this is an instance of in the view's case. Perhaps the view class? ...I'm not much of a CodeIgniter user. |
Sooo....I found a couple things:
What I ended up doing was creating two helper functions:
So now, we just do, for case 1: if(web_calling_enabled()) { And for case two: if(count_callerid_numbers()==1) { or if(count_callerid_numbers()>1) { I'll add this stuff here in a moment. |
…lper. Moved everything in views over to utilize those helpers.
What do you see as the path going forward on this & #232? |
If we can create/retrieve an AppSid automatically, we can completely skip this issue. My preference is to move towards properly auto-configuring the system as opposed to disabling functionality. |
I think this handles #230 fairly well from an interface perspective.