Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $view = Views::getView('view_id'); // view_id - refers the machiene name of the view
- $view->setDisplay('display_id'); // display_id - refered to the current view display which you want to render the result from.
- $view->setArguments($args); // Where $args is the array contains the filter value for uid.
- $view->execute();
- foreach($view->result as $row){
- dpm($row->_entity->get('Custom text')->getValue());
- }
- // or
- $view_result = \Drupal::service('renderer')->render($view->render());
Add Comment
Please, Sign In to add comment