$value = intval($_POST['val']);
if ($value >= 1 && $value <= 5) {
echo 'ok';
} else {
echo 'error';
}
<? $firstFlag = true; ?>
<? while ($query1->have_posts()): $query1->the_post(); ?>
<article class="<?= $firstFlag ? 'big' : 'small' ?>">
<!-- ТУТ HTML РАЗМЕТКА -->
</article>
<? $firstFlag = false; ?>
<? endwhile; wp_reset_postdata(); ?>
$number = cal_days_in_month(CAL_GREGORIAN, 3, 2017);
for($i = 1; $i <= $number; ++$i){
echo $i;
}
public function actionGetPartner($id){
$partner = Partner::find()->where(['id' => (int)$id])->asArray()->one();
print_r($partner );
}
public function actionGetPartner($id){
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
$partner = Partner::find()->where(['id' => (int)$id])->asArray()->one();
return $partner;
}