How to change Start and Submission not to be required [closed] - php

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

Related

Calendar in Zend Framework dynamique [closed]

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

How to make a sitemap using zend framework 1 [closed]

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);
}

Yii, CJuiDatePicker how to show calendar for last 12 month ignore running(current) month [closed]

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)

Filter Placeholders with Yii2 [closed]

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'],
],

PHP Multidimensional array with foreach [closed]

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 8 years ago.
Improve this question
Trying to build the multidimensional array with a foreach using record from a db...
$servDetails = array(
// CSS Servers
'css' => array(
'server1' => array(
'id' => 'id1',
'type' => 'css',
'host' => 'ip:port'
),
'server2' => array(
'id' => 'id2',
'type' => 'css',
'host' => 'ip:port'
)
)
);
What's the best way of doing this?
Assuming you have executed and have populated an associative array:
// create your containing array
$servDetails = array('css' => array());
// iterate over the results
foreach ($results as $result) {
$servDetails['css'][$result['server_name']] = array(
'id' => $result['server_id'],
'type' => 'css',
'host' => $result['server_ip'] . ':' . $result['server_port']
);
}
I'm not sure where the 'css' portion comes from in your sample, so you may have to adjust this to make it dynamic (if it is in fact dynamic).
You could also build this array structure directly when pulling the results from the db:
if ($results = $mysqli->query($query)) {
while ($result = $results->fetch_assoc()) {
$servDetails['css'][$result['server_name']] = array(
'id' => $result['server_id'],
'type' => 'css',
'host' => $result['server_ip'] . ':' . $result['server_port']
);
}

Categories