Render partially views into view

29 views
Skip to first unread message

acam...@prosystem.es

unread,
Mar 2, 2014, 5:27:53 PM3/2/14
to tot...@googlegroups.com
Hi Peter,

I have a view with 2 views and one template(Pagination) inside .

Can i render only one of this without render other views?

Thanks in advance.

Peter Širka

unread,
Mar 2, 2014, 5:49:18 PM3/2/14
to
Hello,
You can render view without layout?

Example 01:
insert into the view:

@{layout('')}

<html>
   
..
   
..
</html>

Example 02:

@{viewToggle(bool == true, 'view-one')}
@{viewToggle(bool == false, 'view-tow')}

Example 03:

@{if bool === true}
   
@{view('view-one')}
@{else}
   
@{view('view-two')}
@{endif}

Thanks.


acam...@prosystem.es

unread,
Mar 2, 2014, 5:58:25 PM3/2/14
to tot...@googlegroups.com, acam...@prosystem.es
No ,i can not...

This is my view

<html>
@{view('search_products')}
@{view('edition_products',model.data)}
@{template('pagination_products',model.pagination)}
</html>

I need refresh the pagination_products or edition_products.

Peter Širka

unread,
Mar 2, 2014, 6:20:49 PM3/2/14
to tot...@googlegroups.com, acam...@prosystem.es
Mhh, OK:

if model.data === undefined or model.data === null then pagination else edit

<html>

@{view('search_products')}

@{if model.data}
    @{view('edition_products',model.data)}
@{else}
    @{template('pagination_products',model.pagination)}
@{endif}

</html>

... or better solution:

if model.data === undefined or model.data === null then pagination else edit

<html>
    @{view('search_products')}
    @{viewToggle(model.data, 'edition_products',model.data)}
    @{templateToggle(model.pagination, 'pagination_products',model.pagination)}
</html>

Reply all
Reply to author
Forward
0 new messages