Comments (6)
I think you can supply value_options
with an assoc array (key => value, value => label). Internally I believe it calls setValueOptions()
: http://framework.zend.com/manual/current/en/modules/zend.form.element.multicheckbox.html
i.e.:
'multiCheckboxOption' => array(
'input_type' => 'multicheckbox',
'label' => 'MultiCheckbox Option',
//'value_options' => array('Foo', 'Bar', 'Dev', 'Null'), // value and label are the same
'value_options' => array('foo' => 'Foo Label', 'bar' => 'Bar Label'), // value and label are different
'default_value' => array('foo'),
),
from cgmconfigadmin.
@cgmartin i tried, doesnt work, also if you have multiple values selected, it only returns 1 value, not all the selected values
from cgmconfigadmin.
I can't replicate this behavior, it works for me with ZF 2.1.4 and 2.3.7. Here is the config I used:
https://gist.github.com/cgmartin/02a939557c9517a8830e#file-cgnconfigadmin-global-php-L61
And the getConfigValue
which returns multiple selected values:
https://gist.github.com/cgmartin/02a939557c9517a8830e#file-indexcontroller-php
array(4) {
[0] => string(3) "foo"
[1] => string(3) "bar"
[2] => string(3) "dev"
[3] => string(4) "null"
}
from cgmconfigadmin.
sorry about that, was a false alarm, turned out the config was cached :( ....
from cgmconfigadmin.
@cgmartin i just realized it works only if you have as key
a non-numeric string, basically i cant make this work because i need the values to be integers and not strings. is all related to this function
protected function isAssocArray($arr)
{
return (bool)count(array_filter(array_keys($arr), 'is_string'));
}
from cgmconfigadmin.
IIRC, by default, the input elements operate off of string type values for the options (since that is what they are ultimately rendered and received as via the web page as HTML). There are "filters", that can be used to convert the data, but I doubt they are supported in this project. PRs are welcome, but as a workaround you might consider converting to int manually when retrieving.
from cgmconfigadmin.
Related Issues (12)
- Tooltips on inputs
- Table of contents for long list of settings
- Filters the subform? HOT 2
- how to use in Module.php or in Controller? HOT 2
- cgmconfigadmin module HOT 1
- Is it possible to have config groups other than 'site'?
- Password type does not hold value
- Composer install error HOT 2
- Doctrine ORM support HOT 3
- Tabbed settings HOT 2
- Alert when in Preview Mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cgmconfigadmin.