Closed (outdated)
Project:
Context
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Mar 2008 at 03:43 UTC
Updated:
20 Nov 2020 at 16:46 UTC
Jump to comment: Most recent
Comments
Comment #1
jmiccolis commentedI see the value with using function to establish context, but I'm not sure about doing at at in context_get. I don't think I want to make it possible to set context in what is explicity a '_get' function. I'm curious as to how your using context where this has come up - is this inside a panels setup?
I've been looking with a clean way to set a context value as a function - either by using a object (with methods) to establish an entire context namespace, or pushing an anonymous function in as a context value. Either approach could be quite useful and provide a lot of flexibility with how a context could behave, but so far I'm not really happy with any of these approaches.
Comment #2
moshe weitzman commentedYes, this came up within panels.
How about context_get_always() or context_get_callback(). I suggest 'always' because you are guaranteed to get a context back from this call.
Comment #3
moshe weitzman commentedAny further thoughts here? The menu system works with callback functions so it would be quite drupalish to use them here.
Comment #4
dmitrig01 commented<?
+ context_set($space, $key = null, $return);
?>
Comment #5
dmitrig01 commentedI'm sort of neutral on the idea. We don't do that kind of thing with cache - we use the if (!cache_get()) cache_set() etc. type of thing, and that's currently what context does. So IMO it's drupalish how it is too
Comment #6
paulocsClosing all issues from 5.x.* as it is not supported anymore.
If you need this in the supported issues, please open another issue.