Watch view file in anywhere.

Finding from scope first, then try to find from application view.

@param  string $view
@param  array  $args
@param  string $type
@return Theme
160786
public function watch($view, $args = array(), $type = null)
    {
        try {
            return $this->scope($view, $args, $type);
        } catch (\InvalidArgumentException $e) {
            return $this->of($view, $args, $type);
        }
    }
1070868
public function view($view, $data = array(), $status = 200, array $headers = array())
	{
		return static::make($this->view->make($view, $data), $status, $headers);
	}
168806
public function run($args)
	{
		if(!isset($args[0],$args[1]))
		{
			echo "Error: both model class and view name are required.\n";
			echo $this->getHelp();
			return 1;
		}
		$scenario=isset($args[2]) ? $args[2] : '';
		$modelClass=Yii::import($args[0],true);
		$model=new $modelClass($scenario);
		$attributes=$model->getSafeAttributeNames();

		$templatePath=$this->templatePath===null?YII_PATH.'/cli/views/shell/form':$this->templatePath;
		$viewPath=Yii::getPathOfAlias($args[1]);
		$viewName=basename($viewPath);
		$viewPath.='.php';
		$params=array(
			'modelClass'=>$modelClass,
			'viewName'=>$viewName,
			'attributes'=>$attributes,
		);
		$list=array(
			basename($viewPath)=>array(
				'source'=>$templatePath.'/form.php',
				'target'=>$viewPath,
				'callback'=>array($this,'generateForm'),
				'params'=>$params,
			),
		);

		$this->copyFiles($list);

		$actionFile=$templatePath.'/action.php';
		if(!is_file($actionFile))  // fall back to default ones
			$actionFile=YII_PATH.'/cli/views/shell/form/action.php';

		echo "The following form view has been successfully created:\n";
		echo "\t$viewPath\n\n";
		echo "You may use the following code in your controller action:\n\n";
		echo $this->renderFile($actionFile,$params,true);
		echo "\n";
	}
1245087
public function make($view, $data = [])
    {
        if ( ! file_exists($view)) {
            throw new ViewNotFoundException("No file found at '{$view}'");
        }

        ob_start();

        if ( ! empty($data)) {
            extract($data);
        }

        include($view);

        return ob_get_clean();
    }
1098133
protected function _find_view($view)
    {
        //edit view string : example view1.view2....
        $view = str_replace('.', '/', $view);
        // Default location
        $full_path = APPPATH . 'views/' . $view . $this->blade_ext;
        // Modular Separation / Modular Extensions has been detected
        if (method_exists($this->router, 'fetch_module')) {
            $module = $this->router->fetch_module();
            list($path, $_view) = Modules::find($view . $this->blade_ext, $module, 'views/');
            if ($path) {
                $full_path = $path . $_view;
            }
        }
        // File not found
        if (!is_file($full_path)) {
            show_error('[Blade] Unable to find view: ' . $view);
        }

        return $full_path;
    }
718436
public function findView($view)
	{
		$view = $this->viewFolder.DIRECTORY_SEPARATOR.ltrim($view, DIRECTORY_SEPARATOR);

		return $this->finder->findFileReversed($view);
	}
413461
public function render(Renderable $renderer, $view, $argv = null, $displayImmediately = false)
    {
        $this->renderer = $renderer;
        $this->createAdapter();
        if (is_array($argv) && !empty($argv)) foreach ($argv as $k=>$v) {
            $this->adapter->assignVar($k, $v);
        }
        $this->adapter->assignVar('application', \Devil::app());
        $this->adapter->assignVar('this', $this->renderer);
        if ($displayImmediately) {
            $this->adapter->display($view);
            return true;
        } else {
            return $this->adapter->fetch($view);
        }
    }
672519
function widget( $args, $instance ) {

		global $post; // setup_postdata() needs this

		// Available widgets
		$widgets = ChurchThemeFrameworkWidgets::widgetList();

		// Get template filename
		$template_file = $widgets[$this->id_base]['template_file'];

		// Check if template exists
		$template_path = CTFW_WIDGETS_WIDGET_TEMPLATE_DIR . '/' . $template_file;

		// Sanitize widget instance (field values) before loading template
		$instance = $this->ctc_sanitize( $instance );

		// Make instance available to other methods used by template (e.g. get_posts())
		$this->ctc_instance = $instance;

		if( file_exists( $template_path ) ){
			include $template_path;
		}


	}
761788
public function customizeViewArguments($args, $view)
    {
        if ('view' == $view) {
            $session = $this->get('session');

            /** @var \MauticPlugin\MauticContactClientBundle\Entity\ContactClient $item */
            $item = $args['viewParameters']['item'];

            // Setup page forms in session
            if ('POST' == $this->request->getMethod() && $this->request->request->has('contactclient_chart')) {
                $chartFilterValues = $this->request->request->get('contactclient_chart');
            } else {
                $chartFilterValues = $session->get('mautic.contactclient.'.$item->getId().'.chartfilter')
                    ? $session->get('mautic.contactclient.'.$item->getId().'.chartfilter')
                    : [
                        'date_from' => $this->get('mautic.helper.core_parameters')->getParameter(
                            'default_daterange_filter',
                            'midnight -1 month'
                        ),
                        'date_to'   => 'midnight tomorrow -1 second',
                        'type'      => '',
                    ];
            }

            if ($this->request->query->has('campaign')) {
                $chartFilterValues['campaign'] = $this->request->query->get('campaign');
            }

            if (!isset($chartFilterValues['campaign']) || empty($chartFilterValues['campaign'])) {
                $chartFilterValues['campaign'] = null;
            }

            $session->set('mautic.contactclient.'.$item->getId().'.chartfilter', $chartFilterValues);

            //Setup for the chart and stats datatable
            /** @var \MauticPlugin\MauticContactClientBundle\Model\ContactClientModel $model */
            $model = $this->getModel('contactclient');

            $unit = $model->getTimeUnitFromDateRange(
                new \DateTime($chartFilterValues['date_from']),
                new \DateTime($chartFilterValues['date_to'])
            );

            $auditLog = $this->getAuditlogs($item);
            $files    = $this->getFiles($item);
            if (in_array($chartFilterValues['type'], [''])) {
                $stats = $model->getStats(
                    $item,
                    $unit,
                    new \DateTime($chartFilterValues['date_from']),
                    new \DateTime($chartFilterValues['date_to']),
                    $chartFilterValues['campaign']
                );
            } else {
                $stats = $model->getStatsBySource(
                    $item,
                    $unit,
                    $chartFilterValues['type'],
                    new \DateTime($chartFilterValues['date_from']),
                    new \DateTime($chartFilterValues['date_to']),
                    $chartFilterValues['campaign']
                );
            }

            $chartFilterForm = $this->get('form.factory')->create(
                'contactclient_chart',
                $chartFilterValues,
                [
                    'action' => $this->generateUrl(
                        'mautic_contactclient_action',
                        [
                            'objectAction' => 'view',
                            'objectId'     => $item->getId(),
                        ]
                    ),
                ]
            );

            $args['viewParameters']['auditlog']        = $auditLog;
            $args['viewParameters']['files']           = $files;
            $args['viewParameters']['stats']           = $stats;
            $args['viewParameters']['chartFilterForm'] = $chartFilterForm->createView();

            //unset($chartFilterValues['campaign']);
            $session->set('mautic.contactclient.'.$item->getId().'.chartfilter', $chartFilterValues);
        }

        return $args;
    }
121782
public function display($controller, $template, $args = array())
    {
        $view = new View($controller);
        return $view->display($template, $args);
    }
894809
function (args, callback) {
            var a = _.extend({}, args, {
                method: 'createWithView'
            });
            this._openWithViewManager(a, callback);
        }
582598
protected function resolveFromThemeFilepath( $view ) {
		$file = locate_template( $view, false );

		if ( ! $file ) {
			// Try adding a .php extension.
			$file = locate_template( $view . '.php', false );
		}

		return $file;
	}
174872
public function listen($args = null)
    {
        if ('action' === $this->getModel()->getType()) {
            return do_action($this->getModel()->getIdentifier(), $args);
        }

        return apply_filters($this->getModel()->getIdentifier(), $args);
    }
924945
public function assets( $url, $view, $args, $field, $echo = true ) {
		return $this->get_view( $view, array_merge( $args, [
			$field => $url,
		] ), $echo, true, true );
	}
47046
public function ofWithLayout($view, $args = array(), $type = null)
    {
        $view = $this->getLayoutName().'.'.$view;

        return $this->of($view, $args, $type);
    }
1100750
public function partialWithLayout($view, $args = array())
    {
        $view = $this->getLayoutName().'.'.$view;

        return $this->partial($view, $args);
    }
120481
public function template(string $view)
    {
        if (file_exists("../App/Views/".$view.".php")) {
            require_once "../App/Views/".$view.".php";
        } else {
            $error = new Error();
            $error->errorMessage("Error: view não encontrada. Verifique o nome do arquivo na pasta view ou na sua classe");
        }
    }