function views_rules_loop in Views Rules 7
Creates a view loop.
This function is as used in a fluent interface. Note that, much like the loop provided by Rules, a view loop is used as an action.
Parameters
string $view_name: Machine name of the view to use.
string $display_name: Machine name of the specific display in the view to use.
array $settings: Parameter and row variable settings. Specify view contextual filters as parameters, i.e. with data selectors, data processors, etc., using variable machine names configured in the Rules display parameter info. Specify available row variables in the syntax of provided variables, using variable machine names configured in the Rules display variable info. The following is an example of settings in a rule with variable "term" of type Taxonomy term, given a view with contextual filter "tid" for term ID and row variable "node" for node ID (configured as variable type Node):
<code> array( 'tid:select' => 'term:tid', 'node:var' => 'node', 'node:label' => 'Node', ) </code>
Return value
3 calls to views_rules_loop()
- ViewsRulesViewLoopTestCase::createTestComponent in tests/
views_rules.test - Creates an action set to test a view loop.
- ViewsRulesViewLoopTestCase::createTestNonFieldComponent in tests/
views_rules.test - Creates an action set to test a view loop for a non-field view.
- views_rules_add_view_loop_submit in rules/
views_rules.rules_admin.inc - Provides a variant of rules_ui_add_element_submit() to create a view loop.
File
- ./
views_rules.module, line 144 - Views & Rules deep-level integration.
Code
function views_rules_loop($view_name, $display_name, array $settings = array()) {
return new ViewsRulesLoop($view_name, $display_name, $settings);
}