本文整理汇总了PHP中Illuminate\Support\Facades\View::make方法的典型用法代码示例。如果您正苦于以下问题:PHP View::make方法的具体用法?PHP View::make怎么用?PHP View::make使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\View
的用法示例。
在下文中一共展示了View::make方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Render the field.
*
* @access public
* @return mixed|string
*/
public function render()
{
switch ($this->getContext()) {
case BaseField::CONTEXT_LIST:
$values = [];
foreach ($this->getValue() as $item) {
$values[] = $item->{$this->getDisplayField()};
}
return implode(', ', $values);
break;
case BaseField::CONTEXT_FORM:
$baseModel = $this->getAdmin()->getModel();
$baseModel = new $baseModel();
$primaryKey = $baseModel->getKeyName();
$relatedModel = $baseModel->{$this->getName()}()->getRelated();
$relatedModel = get_class($relatedModel);
$items = [];
foreach ($relatedModel::all() as $item) {
$items[$item->{$primaryKey}] = $item->{$this->getDisplayField()};
}
$id = $this->getAdmin()->getFormBuilder()->getIdentifier();
$values = [];
foreach ($relatedModel::where(Str::singular($baseModel->getTable()) . '_id', $id)->get() as $item) {
$values[] = (string) $item->{$primaryKey};
}
return View::make('krafthaus/bauhaus::models.fields._has_many')->with('field', $this)->with('items', $items)->with('values', $values);
break;
}
}
示例2: getEditBancaEntitate
public function getEditBancaEntitate($id, $id_entitate, $entitate)
{
$banca_class = new BancaController();
$banci = $banca_class->getBanciOrganizatie();
$banca = DB::select("SELECT\n id,\n id_banca,\n iban, \n sucursala\n FROM banca_entitate\n\t\t\tWHERE id = :id", array('id' => $id));
return View::make("banca::banca_entitate.edit")->with("banca", $banca[0])->with("banci", $banci)->with("id_entitate", $id_entitate)->with("entitate", $entitate);
}
示例3: getResize
/**
* Dipsplay image for resizing
*
* @return mixed
*/
public function getResize()
{
$ratio = 1.0;
$image = Input::get('img');
$path_to_image = parent::getPath('directory') . $image;
$original_width = Image::make($path_to_image)->width();
$original_height = Image::make($path_to_image)->height();
$scaled = false;
if ($original_width > 600) {
$ratio = 600 / $original_width;
$width = $original_width * $ratio;
$height = $original_height * $ratio;
$scaled = true;
} else {
$width = $original_width;
$height = $original_height;
}
if ($height > 400) {
$ratio = 400 / $original_height;
$width = $original_width * $ratio;
$height = $original_height * $ratio;
$scaled = true;
}
return View::make('laravel-filemanager::resize')->with('img', parent::getUrl('directory') . $image)->with('height', number_format($height, 0))->with('width', $width)->with('original_height', $original_height)->with('original_width', $original_width)->with('scaled', $scaled)->with('ratio', $ratio);
}
示例4: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$task = Task::find($id);
$projects = Project::lists('name', 'id');
//
return View::make('tasks.edit', compact('task', 'projects'));
}
示例5: getIndex
public function getIndex($id)
{
if (Auth::check()) {
$users_id = Auth::user()->id;
$role = DB::table('role_user')->where('user_id', '=', $users_id)->first();
$role_id = $role->role_id;
//dd($role_id);
if ($role_id == 2 || $role_id == 3 || $role_id == 4) {
return redirect(url());
} else {
//dd(\Config::get("mail"));
$username = $id;
$user_id = DB::table('users')->where('username', $id)->pluck('id');
$email = DB::table('users')->where('username', $id)->pluck('email');
$image = "images/users/" . $username . "/" . DB::table('users')->where('username', $id)->pluck('photo');
$name = DB::table('users')->where('username', $id)->pluck('firstName') . " " . DB::table('users')->where('username', $id)->pluck('lastName');
$verify = DB::table('users')->where('username', $id)->pluck('verify_key');
$verification_link = "http://localhost/seriousdatings_app/public/users/" . $user_id . "/verify/" . $verify;
$data = array();
$data = ['email' => $email, 'image' => $image, 'name' => $name, 'username' => $id, 'verification_link' => $verification_link, 'image_link' => 'http://seriousdatings.com/images/logo.jpg', 'contact_address' => ''];
Mail::send('mailtemplate', $data, function ($message) {
$message->to('softechsgd@gmail.com', 'ID')->subject('Verify your seriousdatings account');
});
//Session::flush();
return View::make('verify_email')->withData($data);
}
} else {
return redirect(url() . '/login');
}
}
示例6: getEdit
public function getEdit($id)
{
// Find the product using the user id
$product = Product::find($id);
// No such id
if ($product == null) {
return \View::make('redminportal::pages/404');
}
$categories = array();
foreach (Category::all() as $category) {
$categories[$category->id] = $category->name;
}
$tagString = "";
foreach ($product->tags as $tag) {
if (!empty($tagString)) {
$tagString .= ",";
}
$tagString .= $tag->name;
}
if (empty($product->options)) {
$product_cn = (object) array('name' => $product->name, 'short_description' => $product->short_description, 'long_description' => $product->long_description);
} else {
$product_cn = json_decode($product->options);
}
return View::make('redminportal::products/edit')->with('product', $product)->with('product_cn', $product_cn)->with('imageUrl', 'assets/img/products/')->with('categories', $categories)->with('tagString', $tagString);
}
示例7: ProsesJadwal
public function ProsesJadwal($id)
{
$data = DB::table('prestasi_kerja_rekap_penilaian')->join('lpp_kemenpan_siasik.daf_unit_staf', 'prestasi_kerja_rekap_penilaian.id_jabatan', '=', 'lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id')->join('lpp_kemenpan_siasik.master_pegawai', 'prestasi_kerja_rekap_penilaian.nip', '=', 'lpp_kemenpan_siasik.master_pegawai.nip')->join('lpp_kemenpan_siasik.daf_gol', 'lpp_kemenpan_siasik.daf_unit_staf.eselon_id', '=', 'lpp_kemenpan_siasik.daf_gol.gol_id')->select('prestasi_kerja_rekap_penilaian.nip', 'prestasi_kerja_rekap_penilaian.id_jabatan', 'lpp_kemenpan_siasik.daf_unit_staf.nama_lengkap', 'lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id', 'lpp_kemenpan_siasik.master_pegawai.nama', 'lpp_kemenpan_siasik.daf_gol.pangkat', 'lpp_kemenpan_siasik.daf_gol.golongan')->where('lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id', '=', $id)->first();
$breadcrumbs = array(array("Assessment Internal" => "javascript:void(0)"), array("Pengaturan" => ""), array("Tambah Kandidat Promosi" => ""));
$this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
$this->layout->content = View::make('career::jadwal/jadwalasessment', compact('data'));
}
示例8: setupLayout
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
{
$this->layout = View::make(Config::get('syntara::views.master'));
$this->layout->title = 'VietSol CMS';
$this->layout->breadcrumb = array();
View::share('siteName', 'VietSol CMS');
}
示例9: login
public function login()
{
Session::set('admin_lock_url', null);
$loginForm = new KForm();
$loginForm->addField(FormFieldBase::createByType('login', FormFieldBase::Type_Text)->setRules('required')->setLabel('请输入工号'));
$loginForm->addField(FormFieldBase::createByType('password', FormFieldBase::Type_Password)->setRules('required')->setLabel('请输入密码'));
if (AuthModel::user() !== null) {
return Redirect::action('admin.index');
}
if (Request::isMethod('POST')) {
//是管理员登陆请求
if ($loginForm->validation()) {
$login = $loginForm->value('login');
$password = $loginForm->value('password');
if (AuthModel::attempt(['employee_id' => $login, 'password' => $password])) {
$admin = AuthModel::getUser();
$admin->last_login = new \Carbon\Carbon();
$admin->save();
return Redirect::action('admin.index');
} else {
$loginForm->set_error('password', '错误的用户名或密码');
}
} else {
//
}
}
$this->layout = View::make('laravel-cms::admin-lte/login')->with('form', $loginForm);
}
示例10: setupLayout
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
{
if (!is_null($this->layout)) {
$cb_js_var = array('site_url' => url('/'), 'admin_url' => url('/admin'), 'admin_assets_url' => asset('packages/vizioart/cookbook/'), 'admin_api_url' => url('/admin/api'));
$this->layout = View::make($this->layout, array('cb_js_var' => $cb_js_var));
}
}
示例11: showConfirmationPage
public function showConfirmationPage()
{
$view = \Illuminate\Support\Facades\View::make('publicPages.demoRequest.confirmationPage');
$this->layout->title = 'Your request has been received';
$this->setInnerNav();
$this->layout->content = $view->render();
}
示例12: template
public function template(Template\Manager $manager)
{
parent::template($manager);
$manager->findAndInstallNewTemplates();
$templates = $manager->getValidTemplates();
return ViewFacade::make("{$this->viewPrefix}.template", ['current' => $this->page->getTemplate(), 'templates' => $templates]);
}
示例13: index
/**
* phEstadisticasController constructor.
*/
public function index()
{
$days = Input::get('days', 7);
$range = \Carbon\Carbon::now()->subDays($days);
$stats = User::where('created_at', '>=', $range)->groupBy('date')->orderBy('date', 'DESC')->remember(1440)->get([DB::raw('Date(created_at) as date'), DB::raw('COUNT(*) as value')])->toJSON();
$this->layout->content = View::make('home', compact('stats'));
}
示例14: getEditPersoana
public function getEditPersoana($id_persoana)
{
$ocupatii_class = new OcupatiiController();
$ocupatii = $ocupatii_class->getOcupatiiOrganizatie(true);
$persoana = DB::select("SELECT \n p.nume,\n p.cnp,\n p.telefon_1,\n p.telefon_2,\n p.mail_1,\n p.mail_2,\n o.id AS id_ocupatie\n FROM personal p\n LEFT OUTER JOIN ocupatie o ON o.id = p.id_ocupatie AND o.logical_delete = 0\n WHERE p.logical_delete = 0\n AND p.id = :id_persoana", array('id_persoana' => $id_persoana));
return View::make('entitate::personal.edit')->with('persoana', $persoana[0])->with('ocupatii', $ocupatii);
}
示例15: sendException
public function sendException($exception)
{
if (!$this->isErrorFromBot()) {
$recipients = Config::get("error-emailer::to");
if (isset($recipients['address'])) {
// this is a single recipient
if ($recipients['address']) {
$recipients = array($recipients);
} else {
$recipients = array();
}
}
if (sizeof($recipients) > 0) {
if ($exception instanceof FlattenException) {
$flattened = $exception;
} else {
$flattened = FlattenException::create($exception);
}
$handler = new ExceptionHandler();
$content = $handler->getContent($flattened);
$model = array('trace' => $content, 'exception' => $exception, 'flattened' => $flattened);
Mail::send(Config::get("error-emailer::error_template"), $model, function ($message) use($model, $recipients) {
$subject = View::make(Config::get("error-emailer::subject_template"), $model)->render();
$message->subject($subject);
foreach ($recipients as $to) {
$message->to($to['address'], $to['name']);
}
});
}
}
}