本文整理匯總了PHP中Illuminate\Contracts\View\View::getPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP View::getPath方法的具體用法?PHP View::getPath怎麽用?PHP View::getPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Contracts\View\View
的用法示例。
在下文中一共展示了View::getPath方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getPath
/**
*
* return the path of the actually view
*
* @return string
* @throws ViewException
*/
public function getPath()
{
if (is_null($this->view)) {
throw new ViewException('View is not defined');
}
return $this->view->getPath();
}
示例2: compose
/**
* Bind data to the view.
*
* @param View $view
*
* @throws \Exception
*/
public function compose(View $view)
{
if (empty($view->name) and !str_contains($view->getName(), ['csrf', 'group'])) {
//TODO: check if these exceptions can actually be caught. Perhaps it needs to log to file instead?
throw new \Exception('Input needs a "name" parameter set in ' . $view->getPath());
}
$data['control_id'] = $view->bsb_pkg_ref . $view->form_id . $view->name;
//TODO: handle unique id if name is repeated within the form with [] array syntax and radios/checkboxes
if (!empty($view->name) and $view->errors->has($view->name)) {
$data['has_error'] = true;
if (!$view->group_form_errors) {
$view->nest('control_error_content', $view->bsb_pkg_ref . '::form.control.errors', ['errors' => $view->errors->get($view->name)]);
}
}
if ($view->control_error_content or $view->help_text or $view->html_help_text) {
$data['control_description_id'] = $data['control_id'] . 'desc';
}
$view->with($data);
}