How can i have the form text empty? - php

I dont know the way to leave the the form text empty is there is no result.I need something like this.....
If there is no userCreator = form text empty
My code
<div class="col-md-4">
<div class="form-group">
{{ Form::label('userCreator','UserCreator') }}
#if(isset($userCreator))
#foreach($userCreator as $cs)
{{ Form::text('userCreator',$cs->home_lastname,['class'=>'form-control']) }}
#endforeach
#else{ {{-- What should i put inside here ? --}}
}
#endif
</div>
</div>

#if(isset($userCreator) && count($userCreator) > 0)
<div class="col-md-4">
<div class="form-group">
{{ Form::label('userCreator','UserCreator') }}
#foreach($userCreator as $cs)
{{ Form::text('userCreator',$cs->home_lastname,['class'=>'form-control']) }}
#endforeach
</div>
</div>
#endif

try this ...
<div class="col-md-4">
<div class="form-group">
{{ Form::label('userCreator','UserCreator') }}
#if(!empty($userCreator))
#foreach($userCreator as $cs)
{{ Form::text('userCreator',$cs->home_lastname,['class'=>'form-control']) }}
#endforeach
#else
{{ Form::text('userCreator','', ['class'=>'form-control']) }}
#endif
</div>
</div>

Related

Laravel 5: Updatable List|Table

I'm trying to create an "updatable" order list|table where the user can change one dropdown value of the list to "take in charge" all orders listed.
(PS: user will also have the possibility to filter the list in order to take in charge only specific orders | order-row checkboxes will be removed since not necessary).
I have created my controller (using not Eloquent but query builder to query the data).
I'm passing my data to my view.
I can view the expected records in the list|table.
User can choose his name into the first order row dropdown called "Prise en charge", then all other order rows dropdowns values are changed accordingly :
https://www.screencast.com/t/Ei1wdJtb
(link works with Mozilla and Chrome but not Opera)
Now I would like to update with submit all in the table listed orders.
I know how to create CRUDs, but I never created this kind of hybrids, so it is a little bit unclear (or completely honestly said) how to do it.
I would appreciate some expertise about what is missing to submit and update accordingly the database table columns.
CONTROLLER
<?php namespace App\Http\Controllers;
use Session;
use Request;
use DB;
use CRUDBooster;
Use SoftDelete;
class AdminLaboOrdersManagementController extends Controller {
public function updateOrder(Request $request) {
# QUERIES
# I haven't printed the queries since it is not relevant I guess and
# because it takes a lot of space. If needed I will of course provide ...
# SEND TO VIEW
return view('labo_orders_mgt_view_index',
compact('staffs','orders','statusorders'));
}
}
BLADE
Structure
row-id is the row id of the order into the table
<div class="order" row-id="1029">rows and data</div>
<div class="order" row-id="1039">rows and data</div>
<div class="order" row-id="1049">rows and data</div>
<div class="order" row-id="1059">rows and data</div>
<div class="order" row-id="1060">rows and data</div>
<div class="order" row-id="1062">rows and data</div>
Code
#extends('crudbooster::admin_template')
#section('content')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="{{ asset('assets/js/laboratory/takeCareOf.js')}}"></script>
<table class='table table-striped table-bordered'>
<tbody>
{{--dd($staffs)--}}
{{--dd($orders)--}}
<!-- FOREACH LOOP TO DISPLAY THE ORDERS -->
<form method="POST" action="" id="takecareof">
<div class='row button'>
<button type="submit" class="btn btn-primary btn-sm" id="btnFront" style="cursor: pointer;font-size:24px; height:47px;width:100%;"> Je confirme la prise en charge </button>
</div>
#foreach($orders as $order)
<div class="order" row-id="{{$order->rowID}}">
<div class="col-md-1 sub_chkbox">
<input type="checkbox" class="sub_chk" data-id="{{$order->rowID}}">
</div>
<div class="row">
<div class="col-md-2 takecareof">
<h5>Prise en charge par</h5>
<p>
<select name="dropdownlabostaffs" class="dropdownlabostaffs form-control">
#if (isset($staffs))
<option value="">Artisans</option>
#foreach ($staffs as $staff)
<option value="{{ $staff->staffID }}"{{ $staff->staffID == $order->ownerID ? 'selected' : '' }}>{{ $staff->staffName }}</option>
#endforeach
#endif
</select>
</p>
</div>
</div>
#if($order->FirstnameUser === NULL || $order->LastnameUser === NULL)
<div class="row">
<div class="col-md-2 ordernr">
<h5>Commande no</h5>
<p>
{{ $order->orderID }}
</p>
</div>
<div class="col-md-3 orderby">
<h5>Commandé par</h5>
<p>
#if(isset($order->FirstnameUser)) {{ $order->FirstnameUser }} #endif #if(isset($order->LastnameUser)) {{ $order->LastnameUser }} #endif
</p>
</div>
<div class="col-md-3 forcustomer">
<h5>Pour Client</h5>
<p>
#if(isset($order->FirstnameCustomer)) {{ $order->FirstnameCustomer }} #endif #if(isset($order->LastnameCustomer)) {{ $order->LastnameCustomer }} #endif
</p>
</div>
<div class="col-md-3 laboratory">
<h5>Laboratoire</h5>
<p>
{{ $order->Laboratory }}
</p>
</div>
</div>
#else
<div class="row">
<div class="col-md-2 ordernr">
<h5>Commande no</h5>
<p>
{{ $order->orderID }}
</p>
</div>
<div class="col-md-3 orderby">
<h5>Commandé par</h5>
<p>
#if(isset($order->FirstnameUser)) {{ $order->FirstnameUser }} #endif #if(isset($order->LastnameUser)) {{ $order->LastnameUser }} #endif
</p>
</div>
<div class="col-md-3 forcustomer">
<h5>Pour Client</h5>
<p>
#if(isset($order->FirstnameCustomer)) {{ $order->FirstnameCustomer }} #endif #if(isset($order->LastnameCustomer)) {{ $order->LastnameCustomer }} #endif
</p>
</div>
<div class="col-md-3 laboratory">
<h5>Laboratoire</h5>
<p>
{{ $order->Laboratory }}
</p>
</div>
</div>
#endif
<div class="row">
<div class="col-md-6 status">
<h5>Statut</h5>
<p>
<select name="statusorder" class="statusorder form-control">
#if (isset($statusorders))
<option value="">Status</option>
#foreach ($statusorders as $statusorder)
<option value="{{ $statusorder->statusorderID }}"{{ $statusorder->statusorderID == $order->StatusID ? 'selected' : '' }}>{{ $statusorder->statusorderName }}</option>
#endforeach
#endif
</select>
</p>
</div>
<div class="col-md-6 pickup">
<h5>Date | heure de retrait</h5>
<p>
{{ date('d-m-Y', strtotime($order->{'DeliveryDate'})) }} | 13:15
</p>
<p>
</p>
</div>
</div>
<div class="row">
<div class="col-md-2 category">
<h5>Catégorie</h5>
<p>
#if(isset($order->Type)) {{ $order->Type }} #endif
</p>
</div>
<div class="col-md-2 product">
<h5>Produit</h5>
<p>
#if(isset($order->Name)) {{ $order->Name }} #endif
</p>
</div>
#if($order->Type === 'Gâteaux' || $order->Type === 'Tarte' || $order->Type === 'Tarte-fine')
<div class="col-md-2 servings">
<h5># Personnes</h5>
<p>
#if(isset($order->Servings)) {{ $order->Servings }} #endif
</p>
</div>
#endif
#if($order->Type === 'Gâteaux' || $order->Type === 'Tarte' || $order->Type === 'Tarte-fine')
<div class="col-md-2 chocodeco">
<h5>Déco Choco</h5>
#if(strpos($order->DecoChocoFruits, 'souhaitée') !== false)
<p>Oui</p>
#else
<p>Non</p>
#endif
</div>
<div class="col-md-4 flowerdeco">
<h5>Déco Fleurs</h5>
#if(strpos($order->DecoSmallFlowers, 'souhaitée') !== false)
<p>Oui</p>
#else
<p>Non</p>
#endif
</div>
#endif
#if($order->Type === 'Pain-surprise')
<div class="col-md-2 weight">
<h5>Poids</h5>
<p>
#if(isset($order->Weight)) {{ $order->Weight }} #endif
</p>
</div>
<div class="col-md-4 colorribbon">
<h5>
Couleur Ruban
</h5>
<p>
#if(isset($order->RibbonColor)) {{ $order->RibbonColor }} #endif
</p>
</div>
#endif
#if($order->Type === 'Pain')
<div class="col-md-2 breadquantity">
<h5>
Quantité
</h5>
<p>
#if(isset($order->BreadQuantity)) {{ $order->BreadQuantity }} #endif
</p>
</div>
<div class="col-md-6 slicecut">
<h5>
Coupe
</h5>
#if(strpos($order->Cut, 'souhaitée') !== false)
<p>Oui</p>
#else
<p>Non</p>
#endif
</div>
#endif
#if($order->Type === 'Salé')
<div class="col-md-2 savouryquantity">
<h5>
Quantité
</h5>
<p>
#if(isset($order->SavouryQuantity)) {{ $order->SavouryQuantity }} #endif
</p>
</div>
<div class="col-md-6 savouryassortment">
<h5>
Assortiment
</h5>
<p>
#if(isset($order->CanapésAssortment)) {{ $order->CanapésAssortment }} #endif
#if(isset($order->MiniPuffsAssortment)) {{ $order->MiniPuffsAssortment }} #endif
#if(isset($order->VolsAuVentAssortment)) {{ $order->VolsAuVentAssortment }} #endif
#if(isset($order->AppetisersAssortment)) {{ $order->AppetisersAssortment }} #endif
</p>
</div>
#endif
#if($order->Type === 'Sucré')
<div class="col-md-2 sweetquantity">
<h5>
Quantité
</h5>
<p>
#if(isset($order->SweetQuantity)) {{ $order->SweetQuantity }} #endif
</p>
</div>
<div class="col-md-6 sweetassortment">
<h5>
Coupe
</h5>
<p>
#if(isset($order->SweetAssortment)) {{ $order->SweetAssortment }} #endif
</p>
</div>
#endif
</div>
<div class="row">
#if($order->Type === 'Pain-surprise')
<div class="col-md-3 variante1">
<h5>
Assortiment 1
</h5>
<p>
#if(isset($order->Assortment1)) {{ $order->Assortment1 }} #endif
</p>
</div>
<div class="col-md-3 variante2">
<h5>
Assortiment 2
</h5>
<p>
#if(isset($order->Assortment2)) {{ $order->Assortment2 }} #endif
</p>
</div>
<div class="col-md-3 variante3">
<h5>
Assortiment 3
</h5>
<p>
#if(isset($order->Assortment3)) {{ $order->Assortment3 }} #endif
</p>
</div>
<div class="col-md-3 variante4">
<h5>
Assortiment 4
</h5>
<p>
#if(isset($order->Assortment4)) {{ $order->Assortment4 }} #endif
</p>
</div>
#endif
</div>
</div>
#endforeach
</form>
</tbody>
</table>
<!-- ADD A PAGINATION -->
<p></p>
#endsection

symfony- update entity and changed fields

I try editAction in symfony but I have error when if not change input file it update field file in database to null ... how to not update field file if not changed value in update action
code action:
/**
* #Route("/babysitter/update/{id}", name="update_babysitter_by_admin")
*
* #param Request $request
* #param BabySitter $babySitter
* #ParamConverter("id", options={"id": "id"})
*
* #return mixed
*/
public function updateBabySitterAction(BabySitter $babySitter, Request $request){
$em= $this->getDoctrine()->getManager();
$form= $this->createForm(BabySitterType::class, $babySitter,['requiredFile'=> false]);
$form->handleRequest($request);
if($form->isSubmitted() && $form->isValid()){
if($babySitter->getPicture()->getDocument()){
$this->uploadDocument->upload($babySitter->getPicture(), $this->getParameter('pictures_directory'));
}
if($babySitter->getCriminalRecord()->getDocument()){
$this->uploadDocument->upload($babySitter->getCriminalRecord(), $this->getParameter('criminalRecord_director_babySitter'));
}
if($babySitter->getIdCards()){
$this->uploadDocument->uploadIdCard($babySitter->getIdCards(), $babySitter,$this->getParameter('idCard_directory'));
}
$em->persist($babySitter);
$em->flush();
$url = $this->generateUrl('info_babySitter',['id'=> $babySitter->getId()]);
$response = new RedirectResponse($url);
return $response;
}
return $this->render('admin/registerBabySitter.html.twig',[
'form'=> $form->createView()
]);
}
code twig:
{% trans_default_domain 'FOSUserBundle' %}
<div class="register-box" style="width:460px">
<div class="register-box-body">
<p class="login-box-msg">Register a new BabySitter</p>
{{ form_start(form, {'method':'post', 'attr': {'class': 'fos_user_registration_register', 'novalidate': 'novalidate'}}) }}
<div class="form-group has-feedback">
{{ form_widget(form.email,{'attr': {'class': 'form-control', 'placeholder': 'Email'}}) }}
{{ form_errors(form.email) }}
</div>
<div class="form-group has-feedback">
{{ form_widget(form.firstName,{'attr': {'class': 'form-control', 'placeholder': 'FirstName'}}) }}
{{ form_errors(form.firstName) }}
</div>
<div class="form-group has-feedback">
{{ form_widget(form.lastName,{'attr': {'class': 'form-control', 'placeholder': 'LastName'}}) }}
{{ form_errors(form.lastName) }}
</div>
<div class="form-group has-feedback">
{{ form_widget(form.plainPassword.first,{'attr': {'class': 'form-control', 'placeholder': 'Password'}}) }}
{{ form_errors(form.plainPassword.first) }}
</div>
<div class="form-group has-feedback">
{{ form_widget(form.plainPassword.second,{'attr': {'class': 'form-control', 'placeholder': 'Repeat Password'}}) }}
{{ form_errors(form.plainPassword.second) }}
</div>
<div class="form-group has-feedback">
{{ form_widget(form.genre,{'attr': {'class': 'form-control', 'placeholder': 'Genre'}}) }}
{{ form_errors(form.genre) }}
</div>
<div class="form-group has-feedback">
{{ form_widget(form.dateBirth,{'attr': {'class': 'form-control', 'placeholder': 'date Birthday'}}) }}
{{ form_errors(form.dateBirth) }}
</div>
<div class="form-group has-feedback">
{{ form_widget(form.linkVideo,{'attr': {'class': 'form-control', 'placeholder': 'link Video'}}) }}
{{ form_errors(form.linkVideo) }}
</div>
<div class="form-group has-feedback">
{{ form_row(form.criminalRecord) }}
{{ form_errors(form.criminalRecord) }}
</div>
<div class="form-group has-feedback">
<ul id="idCard-fields-list"
data-prototype="{{ form_widget(form.idCards.vars.prototype)|e }}"
data-widget-tags="{{ '<li></li>'|e }}">
{{ form_row(form.idCards) }}
{% for idCardField in form.idCards %}
<li>
{{ form_errors(idCardField) }}
{{ form_widget(idCardField) }}
</li>
{% endfor %}
</ul>
<div class="row">
<button type="button"
class="add-another-collection-widget-idCard btn btn-primary btn-flat"
data-list="#idCard-fields-list">Add another idCard</button>
</div>
</div>
<div class="form-group has-feedback">
{{ form_widget(form.nbrYears,{'attr': {'class': 'form-control', 'placeholder': 'Number Years'}}) }}
{{ form_errors(form.nbrYears) }}
</div>
<div class="form-group has-feedback">
{{ form_widget(form.rib,{'attr': {'class': 'form-control', 'placeholder': ' rib'}}) }}
{{ form_errors(form.rib) }}
</div>
<div class="form-group has-feedback">
{{ form_widget(form.presentation,{'attr': {'class': 'form-control', 'placeholder': 'presentation'}}) }}
{{ form_errors(form.presentation) }}
</div>
<div class="form-group has-feedback">
{{ form_row(form.adress) }}
{{ form_errors(form.adress) }}
</div>
<div class="form-group has-feedback">
{{ form_row(form.availability) }}
{{ form_errors(form.availability) }}
</div>
<div class="form-group has-feedback">
{{ form_row(form.assignement) }}
{{ form_errors(form.assignement) }}
</div>
<div class="form-group has-feedback">
{{ form_row(form.qualification) }}
{{ form_errors(form.qualification) }}
</div>
<div class="form-group has-feedback">
{{ form_row(form.picture) }}
{{ form_errors(form.picture) }}
</div>
<div class="form-group has-feedback">
<ul id="language-fields-list"
data-prototype="{{ form_widget(form.languages.vars.prototype)|e }}"
data-widget-tags="{{ '<li></li>'|e }}">
{{ form_widget(form.languages) }}
{% for languageField in form.languages %}
<li>
{{ form_errors(languageField) }}
{{ form_widget(languageField) }}
</li>
{% endfor %}
</ul>
<div class="row">
<button type="button"
class="add-another-collection-widget btn btn-primary btn-flat"
data-list="#language-fields-list">Add another language</button>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<input type="submit" class="btn btn-primary btn-block btn-flat" value="{{ 'registration.submit'|trans }}">
</div>
<!-- /.col -->
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
</div>
<!-- /.form-box -->
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
jQuery(document).ready(function () {
jQuery('.add-another-collection-widget').click(function (e) {
var list = jQuery(jQuery(this).attr('data-list'));
// Try to find the counter of the list or use the length of the list
var counter = list.data('widget-counter') | list.children().length;
// grab the prototype template
var newWidget = list.attr('data-prototype');
// replace the "__name__" used in the id and name of the prototype
// with a number that's unique to your emails
// end name attribute looks like name="contact[emails][2]"
newWidget = newWidget.replace(/__name__/g, counter);
// Increase the counter
counter++;
// And store it, the length cannot be used if deleting widgets is allowed
list.data('widget-counter', counter);
// create a new list element and add it to the list
var newElem = jQuery(list.attr('data-widget-tags')).html(newWidget);
newElem.appendTo(list);
addTagFormDeleteLink(newElem);
});
function addTagFormDeleteLink($tagFormLi) {
var $removeFormButton = $('<button class="btn btn-danger btn-flat" style="margin-top:2%;margin-left:50%" type="button">Delete this Language</button>');
$tagFormLi.append($removeFormButton);
$removeFormButton.on('click', function(e) {
// remove the li for the tag form
$tagFormLi.remove();
});
}
jQuery('.add-another-collection-widget-idCard').click(function (e) {
var list = jQuery(jQuery(this).attr('data-list'));
// Try to find the counter of the list or use the length of the list
var counter = list.data('widget-counter') | list.children().length;
// grab the prototype template
var newWidget = list.attr('data-prototype');
// replace the "__name__" used in the id and name of the prototype
// with a number that's unique to your emails
// end name attribute looks like name="contact[emails][2]"
newWidget = newWidget.replace(/__name__/g, counter);
// Increase the counter
counter++;
// And store it, the length cannot be used if deleting widgets is allowed
list.data('widget-counter', counter);
// create a new list element and add it to the list
var newElem = jQuery(list.attr('data-widget-tags')).html(newWidget);
if(counter <= 3){ newElem.appendTo(list); }
});
function addIdCardFormDeleteLink($tagFormLi) {
var $removeFormButton = $('<button class="btn btn-danger btn-flat" style="margin-top:2%;margin-left:50%" type="button">Delete this idCard</button>');
$tagFormLi.append($removeFormButton);
$removeFormButton.on('click', function(e) {
// remove the li for the tag form
$tagFormLi.remove();
});
}
});
</script>
when i update entity and i not update field file i have field file in database null ... how to update entity without changed in input file

How to link comments to each post by id with Laravel Blade

I have created a Post and Comment application. I am trying to link the comments to the id of the post. I am trying to use PHP in a Blade template to do this. I get the error that the variable post_id does not exist. I want to use the #if and #foreach of Blade. The problem seems to be in the #if statement.
Here is my HTML:
<div class="col-md-9">
<div class="row">
#foreach($posts as $post)
<div class="col-md-12 post" id="post{{ $post->id }}">
<div class="row">
<div class="col-md-12">
<h4>
{{ $post->title }}
</h4>
</div>
</div>
<div class="row">
<div class="col-md-12 post-header-line">
<span class="glyphicon glyphicon-user"></span> by {{ $post->user->firstName }} {{ $post->user->lastName }} | <span class="glyphicon glyphicon-calendar">
</span> {{ $post->created_at }} | <span class="glyphicon glyphicon-comment"></span><a href="#">
3 Comments</a>
</div>
</div>
<div class="row post-content">
<div class="col-md-2">
<a href="#">
<img src="/images/random/postimg.jpg" alt="" class="img-responsive postImg">
</a>
</div>
<div class="col-md-10">
<p>
{{ $post->post }}
</p>
</div>
</div>
<div class="row add-comment">
<div class="form-group">
<input type="text" name="addComment" placeholder="Add your comment" class="form-control" v-model="comment">
</div>
<input id="addComment" type="submit" name="submitComment" value="Submit Comment" class="btn btn-default" v-on:click="submitComment" data-id="{{ $post->id }}">
</div>
#if($post->comment->post_id == $post->id)
#foreach($post->comment as $comment)
<div class="row">
<div class="col-md-12 mb-r">
<div class="card example-1 scrollbar-ripe-malinka">
<div class="card-body">
<h4 id="section1"><strong>By: {{ $comment->user->firstName }} {{ $comment->user->lastName }}</strong></h4>
<p>{{ $comment->comment }}</p>
</div>
</div>
</div>
</div>
#endforeach
#endif
</div>
#endforeach
</div>
</div>
Here is my PostController:
public function index(){
$posts = Post::with('comment', 'user')->orderBy('id', 'desc')->limit(20)->get();
return view('post.posts')->with('posts', $posts);
}
You don't need #if statement, remove it. $post->comment is a collection, that 's why your are not getting post_id. if you want to check, then check inside foreach.
#foreach($post->comment as $comment)
<div class="row">
<div class="col-md-12 mb-r">
<div class="card example-1 scrollbar-ripe-malinka">
<div class="card-body">
<h4 id="section1"><strong>By: {{ $comment->user->firstName }} {{ $comment->user->lastName }}</strong></h4>
<p>{{ $comment->comment }}</p>
</div>
</div>
</div>
</div>
#endforeach
You need to add post_id to the comments table and use the relationship:
public function comments()
{
return $this->hasMany(Comment::class);
}
Then you'll be able to load related comments:
Post::with('comments', ....
And iterate over posts and their comments:
#foreach ($posts as $post)
#foreach ($post->comments as $comment)
{{ $comment->content }}
#endforeach
#endforeach
I think if you create relationship between Post model and Comment model (post table and comments table), your #if is useless. I recommend you to check your corresponding models.
Your code should be like this,
Post.php
public function comments(){
return $this->morphMany('App\Comments','commentable');
}
Comment.php
public function commentable(){
return $this->morphTo();
}
in my app Comment model is shared by some other models also.
Eg :- User’s Questions also have comments.
Find more details in laravel:Eloquent page

Symfony2 - Empty CSRF token

I deployed a Symfony2 app, but all the forms have empty csrf tokens. This html comes from firebug. As you can see, the tag is properly rendered, but no value is assigned.
<input type="hidden" value="" name="category[_token]" id="category__token">
In my controller:
$form = $this->createForm(new CategoryForm(), new Category());
$form->handleRequest($request);
if ($form->isValid()) {
(...)
}
In the template, the form is inside of a bootstrap 3 modal.
{{ form_start(form) }}
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Voeg een tariefplan toe</h4>
</div>
<div class="modal-body">
<div class="form-group">
{{ form_label(form.name) }}
{{ form_widget(form.name) }}
</div>
<div class="form-group">
{{ form_label(form.parent) }}
{{ form_widget(form.parent, {'attr':{ 'class': 'form-control' }}) }}
</div>
<div class="form-group">
{{ form_label(form.sizes) }}
{{ form_widget(form.sizes, {'attr':{ 'class': 'form-control' }}) }}
</div>
<div class="form-group">
{{ form_label(form.description) }}
{{ form_widget(form.description, {'attr':{ 'class': 'form-control' }}) }}
</div>
{{ form_widget(form._token) }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Annuleren</button>
{{ form_widget(form.save, {'attr':{ 'class': 'btn btn-primary' }}) }}
</div>
</div>
</div>
{{ form_end(form) }}
I also created a gist for the CategoryForm class : http://goo.gl/6NWTkB.
Anyone who knows what I'm missing here?
You must provide the value:
<input type="hidden" value={{ csrf_token('category') }}"" name="category[_token]" id="category__token">
A couple of ideas:
{{ form_end(form) }} should output your token so there's no need to have: {{ form_widget(form._token) }}.
If you have a very large form php might truncate your request vars. Have a look at max_input_vars in your php.ini. Default is 1000 I believe.

Blog posts from category isn't displayed

I've created a page and then put this code
<section class="cont_pad">
<div class="container_12">
<article class="grid_8">
{{ blog:posts limit="5" offset="5" category="adultos" }}
<section class="post">
{{ if imagen_portada }}
<div class="postimg"><img src="{{ url:site }}files/thumb/{{ imagen_portada.id }}/610/220" class="pic2" alt="{{title}}" title="{{title}}"/></div>
{{ endif }}
<div class="entry-date">
<div class="posttime">
<h3>{{ helper:date timestamp=created_on }}</h3>
</div>
<div class="entry-utility">
{{ asset:image file="blog/icon1.png" }} {{ user:display_name user_id=author_id }}
<br/>
{{ if category }}
<span>{{ asset:image file="blog/icon2.png" }} {{ category:title }}</span>
{{ endif }}
{{ if keywords }}
<span>{{ asset:image file="blog/icon2.png" }} {{ keyword }}</span>
{{ endif }}
</div>
</div>
<div class="entry-text">
<h3 class="posttitle">{{ title }}</h3>
<div class="entry-content">
{{ intro }}
<p>{{ helper:lang line="blog:read_more_label" }}</p>
</div>
</div>
</section>
{{ /blog:posts }}
{{ pagination }}
</article>
<article class="grid_4 last-col">
<aside id="sidebar">
{{ widgets:area slug="widgets_blog_adultos" }}
</aside>
</article>
</div>
</section>
inside to show posts from category "adultos" but I'm not getting nothing. I have one post and it's LIVE in this category. What is wrong? I read Blog Plugin Docs also check the Blog Plugin Code at package "PyroCMS\Core\Modules\Blog\Plugins" and can't find where it fails. Also and related to this same question, can I paginate trough all the posts? I need some help here because I can't find what is wrong
Is the timezone on the computer set up wrong? If PyroCMS thinks the "Publish Date" is in the future it wont show it on the frontend.

Categories