import React, { Component, cloneElement } from 'react';
export default class Parent extends Component {
render() {
const { data, children } = this.props;
const childrensArray = React.Children.toArray(children);
return (
<div>
{childrensArray.map((children) => cloneElement(children, { data }))}
</div>
);
}
}
http://test.com/article/description?aID=323&aTitle=teaser+of+this+article
aID=323&aTitle=teaser+of+this+article
это query параметры.'article/description' => 'article/description'
public function actionDescription($aID, $aTitle, $something, $else) {}
public function actionDescription($aID, $aTitle = null, $something = 'default', $else = 1) {}
case ADD_PRODUCT_TO_CART_SUCCESS:
return {
...state,
entities: {
...state.entities,
[action.payload.productUid]: {
...state.entities[action.payload.productUid],
addedToCart: true,
}
}
}
public class Queue<T> {
T q[]; // Array to storage elements in queue
int putloc, getloc;
// indexes of placement and extracting queue elements
Queue(int size) { q = (T[])new Object[size+1];;
// allocate memory for queue
putloc = getloc = 0; }
// put symbol in queue
void put(T ch) {
if(putloc==q.length-1) {
System.out.println(" - Queue is full.");
return; }
putloc++;
q[putloc] = ch; }
// extract symbol from the queue
T get() {
if(getloc == putloc) {
System.out.println(" - Queue is empty.");
return null; }
getloc++;
return q[getloc];
}
}
Queue<int> queue = new Queue<>(5); // не правильно
Queue<Integer> queue = new Queue<>(5); // правильно
analyze
id | name | type
property
id | type | name
analyze_property_value
id | property_id | analyze_id | value
->andWhere(['not', ['price2' => null]])
или
->andWhere(['is not', 'price2', null])
$groupped = array_reduce($arr, function ($current, $item) {
$current[$item['theme']][] = $item['title'];
return $current;
}, []);
foreach ($groupped as $title => $items) {
echo "<b>$title<b/>";
echo "<ul>";
foreach ($items as $item) {
echo "<li>$item</li>";
}
echo "</ul>";
}