Questions tagged [array]
When using this tag, also tag the question with the programming language being used.
15
questions
2
votes
1
answer
29
views
Show more than two values from array
I have the following fields in a component:
<fieldset name="carousel_container">
<field name="carousel" type="Repeatable" icon="list" description=&...
1
vote
1
answer
61
views
Show images and caption from array as images in carousel
I have the following fields in a component:
<fieldset name="carousel_container">
<field name="carousel" type="Repeatable" icon="list" description=&...
1
vote
2
answers
138
views
How to show multidimensional data in my CanvasJS chart?
<?php
$db->setQuery("SELECT MartabehName, COUNT(MartabehCode) FROM `#__dimteacher` GROUP BY MartabehName");
$countMartabehName = $db->loadObjectList();
foreach($countMartabehName ...
0
votes
0
answers
48
views
JSON to String in Joomla
I have the following method to convert JSON to a String
// Convert the JSON-encoded image info into an array
$image = new JRegistry;
$image->loadString($this->item->image, 'JSON');
$this-&...
3
votes
1
answer
62
views
Creating a multidimensional JForm field dynamicaly
Item Model
protected function preprocessForm(JForm $form, $data, $group = 'examplegroup')
{
foreach ($data as $i => $item) {
$field = new \SimpleXMLElement('<field />');
$...
1
vote
2
answers
270
views
In custom fields, array_values() prints "Array"
From the code below, the output is
<meta mytags="tags" content="Array" />
but if I echo the array_values($field->rawvalue), it displays all the populated values from the array.
Can someone ...
0
votes
1
answer
215
views
How to access user-submitted values from a dynamic form?
I want to insert a row in my db-table with inputs from users. The form the users fill out is made with a foreach-loop:
foreach ($results as $row) {
echo '<div class="vm_kampe"><input ...
3
votes
2
answers
337
views
How can I output each item of a multiple list custom field
print_r($item->jcfields);
Array
(
[1] => stdClass Object
(
[id] => 1
[title] => Specialisms
[name] => specialisms
[checked_out] ...
1
vote
1
answer
523
views
JFactory::getApplication()->input->post->get() prunes empty sub arrays/objects
I am sending a POST ajax call like this:
var request = {
option : 'com_ajax',
module : 'mod_test', // to target: mod_test
method : 'Test', // to target: function TestAjax in ...
1
vote
1
answer
49
views
Joomla getting items via model wrong data type
I'm trying to retrieve articles from a particular category to display it as a part of some module located on the homepage. So I set states for model and retrieved the items via:
$items = $model->...
2
votes
2
answers
2k
views
Preprocessing form data before saving to the database
I have a series of checkboxes on my form that together form an array when POST'ed. I want to save this data as a string instead (e.g., "##,##,##") before committing to the database.
Here's what I ...
0
votes
1
answer
389
views
Joomla foreach AssocList - modify array
I have an associative array, where I need to modify 3 values before sending to the db.
Can somebody assist with the proper syntax for accomplishing this?
$db->setQuery($query);
$rows =$db->...
0
votes
2
answers
165
views
How to write a condition to check if a number is a multiple of 30?
How to set up an array so that instead of maximum - an array on multiples of 30 is shown
i.e $max = 30, 60, 90, 120, 150......and so on
If array $max matches on multiple of 30, 60, 90, 120, 150, 180,...
2
votes
2
answers
444
views
Using JInput instead of $_POST
By using var_dump($_POST);, I'm getting the following output:
array(2)
{
["data"] => array(2)
{
["title"] => "XXX"
["server"] => "XXXXXX"
}
["Itemid"] => ...
7
votes
1
answer
562
views
How to access an array in $_GET using JInput?
I've been researching different ways to get an array using JInput.
According to http://docs.joomla.org/Retrieving_request_data_using_JInput there are 2 methods that I can use.
Method1
$jinput = ...