Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [array]

When using this tag, also tag the question with the programming language being used.

Filter by
Sorted by
Tagged with
3
votes
1answer
41 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
2answers
113 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
1answer
126 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
2answers
117 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
1answer
318 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
1answer
38 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
2answers
1k 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
1answer
330 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
2answers
136 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
2answers
424 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
1answer
503 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 = ...