Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 days ago.
Improve this question
I looking to create two custom calenders with Zend Framework, i am hoping the end date (if input is not empty) is bigg than begin date.
If user set end date small than begin date i want to display error message : "can make a date bigg than begin date".
[
'type' => 'calendar',
'name' => 'begindate',
'options' => [
'label' => 'begin date">*</span>',
'label_options' => ['disable_html_escape' => true],
],
'attributes' => [
'data-scvalidators' => 'Required',
'data-required-msg' => 'make the begin date.',
'data-sc-submit' => '.sumbit',
],
],
[
'type' => 'calendar',
'name' => 'enddate',
'options' => [
'label' => 'END DATE',
],
],
The exemple image
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
I don't know which one I should change
'client_name' => 'required|max:250',
'start_date' => 'required|max:250',
'status' => 'required|max:250',
'service_id' => 'required',
'content' => 'required',
'serial_number' => 'required',
'language_id' => 'required',
$portfolio->start_date = $request->start_date;
$portfolio->submission_date = $request->submission_date;
I haven't tried anything. I just want the start and submission dates fields to not be required
Here is a similar question and info what this is all about:
Laravel translate values required_if
And here's GitHub gist of feature which would solve this problem and it is merged in but still not working:
https://github.com/laravel/framework/pull/4037
Here are my validation rules
'input.deliver_to_address' => ['in:to_billing_address,to_other_address']
'input.delivery_company_name' => ['required_if:input.deliver_to_address,to_other_address'],
and here's my validation.php files:
'values' => [
'to_other_address' => 'to other address',
'input.deliver_to_address' => [
'to_other_address' => 'to other address',
],
'deliver_to_address' => [
'to_other_address' => 'to other address',
],
],
As you can see I've tried all possible combinations but still the validation rule displays:
The contact person field is required when deliver to address is to_other_address.
The question is, is it possible to translate array validation values in Laravel?
I'm using Laravel 6.2
Solved:
The issue was that I'm using input.deliver_to_address and when the Validator.php tries to replace the value with translated string, the $key will be validation.values.input.deliver_to_address.to_other_address
so the array structure needs to be like this:
'values' => [
'input' => [
'deliver_to_address' => [
'to_other_address' => 'to other address',
],
],
],
instead of
'values' => [
'input.deliver_to_address' => [
'to_other_address' => 'to other address',
],
],
because of the additional .input in the attribute name.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to create a sitemap for a website that is coded in zf1 but I don't know anything about this.
I've read on google that I need a controller, a view and routes for it but what I found is for zf2 and doesn't works.
Did someone makes this ?
You should use the Zend_Navigation class and navigation sitemap view helper inside a Controller Action, as follows:
public function sitemapAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$items = array(
array(
'title' => 'Title 1',
'label' => 'Label 1',
'uri' => 'https://www.example.com/page1',
'order' => 1,
'type' => 'uri',
'changefreq' => 'weekly',
),
array(
'title' => 'Title 2',
'label' => 'Label 2',
'uri' => 'https://www.example.com/page2',
'order' => 2,
'type' => 'uri',
'changefreq' => 'weekly',
)
);
$nav = new Zend_Navigation($items);
$sitemapOutput = $this->view->navigation($nav)->sitemap();
$this->_response->setHeader('Content-Type', 'text/xml; charset=utf-8')->setBody($sitemapOutput);
}
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
For eg: If running month is march 2016 , than calendar need to display for jan2015 till feb 2016.
Thanks for help in advance.
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'attribute' => 'submitDate',
'model' => $model,
'options' => array(
'dateFormat' => 'dd-mm-yy',
'showOn' => 'both',
'maxDate' => 0,
'buttonImage' => Yii::app()->baseUrl.'/img/icons/calendar_24.png',
'buttonImageOnly' => true,
'changeYear' => true,
'changeMonth' => false,
),
'htmlOptions' => array(
'class' => 'form-control timepicker-control',
'readonly' => true,
),
));
?>
You need to pass minDate and maxDate as shown below to make it work.
<?php
$sd = date('01-m-Y', strtotime('-14 months'));
$ed = date('t-m-Y', strtotime('-1 months'));
$this->widget('zii.widgets.jui.CJuiDatePicker',array(
'attribute' => 'submitDate',
'model' => $model,
'options'=>array(
'dateFormat'=>'dd-mm-yy',
'showOn' => 'both',
'buttonImage' => Yii::app()->baseUrl.'/img/icons/calendar_24.png',
'buttonImageOnly' => true,
'minDate'=>"$sd",
'maxDate'=>"$ed",
'changeYear' => true,
'changeMonth' => false,
),
'htmlOptions'=>array(
'class' => 'form-control timepicker-control',
'readonly' => true,
),
));
?>
It shown last 13 months as per your example of Jan'15 to Feb'16 but if you really need only last 12 months then change -14 months to -13 months for $sd (start date)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Does anyone know how to implement a placeholder or tooltip on the Gridview filter of the Yii2 Framework? I need something that stands out to the user to let them know that textbox is in fact a search filter.
Look forward to hearing responses.
Placeholder could be realized with this:
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
[
'attribute' => 'name',
'filterInputOptions' => [
'class' => 'form-control',
'placeholder' => 'Type in some characters...'
]
],
['class' => 'yii\grid\ActionColumn' ],
],
]); ?>
class should be provided, though it is not a must - it is just the default styling class.
Setting this globally
The only way that I found is in config/web.php that is used for the application configuration:
$config = [
...
'on beforeRequest' => function ($event) {
Yii::$container->set('yii\grid\DataColumn', [
'filterInputOptions' => [
'class' => 'form-control',
'placeholder' => 'Type in some characters...'
]
]);
},
...
];
This is an event handler. On each request DataColumn will be configured to use the placeholder. Some detail information can be found here. Now you don't need to adjust any GridView configuration in order to have the placeholder. In the handler you can change other configurations as well, of course.
yon can also use the tooltip/title with filterOptions
[
'attribute' => 'name',
'label' => 'labelname',
...
....
'filterOptions' => [ 'title' => 'prova'],
],