Reputation: 17
Hello I have an issue when it comes to display my creating product form.
The main problem is that i have some fields different from one category to other and i want to display it just with what is needed for a specific category so what i thought is how i can load a partial based on select list.
The workflow is:
I am selecting the product type
I am selecting category
The form partial is displayed.
Yes i could have done this with jquery hiding and toggling classes with fadeIn and fadeOut but is there a way how this could be performed from the laravel part ?
Upvotes: 0
Views: 757
Reputation: 5005
Well you could use ajax calls to load the proper partials for a specific category.
public function controllerMethod()
{
if (Request::ajax())
{
$partial = Request::input('selected_category_partial_name');
// The foldr stucture would have to be /views/partials/category/name.blade.php
return view("partials.category.$partial");
}
}
Upvotes: 2