本文整理汇总了PHP中URL::to方法的典型用法代码示例。如果您正苦于以下问题:PHP URL::to方法的具体用法?PHP URL::to怎么用?PHP URL::to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URL
的用法示例。
在下文中一共展示了URL::to方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postPacientes
public function postPacientes($cita)
{
if (Request::ajax()) {
$paciente = new Paciente();
$search = Input::get('search');
$limit = Input::get('limit');
$offset = Input::get('offset');
if (empty($search)) {
$datos = $paciente->datos_pacientes(0, 0, $limit, $offset);
$cantidad = Paciente::all()->count();
} else {
$datos = $paciente->datos_pacientes($search, 1, $limit, $offset);
$c = DB::select("SELECT count(id) as cantidad FROM pacientes WHERE concat(`cedula`,' ',`primer_nombre`,' ',`apellido_paterno`) LIKE '%" . $search . "%'");
$cantidad = $c[0]->cantidad;
}
$comilla = "'";
$n = 1;
$data = array();
foreach ($datos as $pacientes) {
$cant_citas = Cita::where('id_paciente', $pacientes->id)->count();
if ($cita == 0) {
$url = '<a href=' . $comilla . URL::to('datos/citas/' . $pacientes->id) . $comilla . ' class=' . $comilla . 'btn btn-primary btn-sm' . $comilla . ' data-toggle=' . $comilla . 'tooltip' . $comilla . ' title=' . $comilla . 'Crear Cita' . $comilla . '><span class=' . $comilla . 'glyphicon glyphicon-list-alt' . $comilla . '></span> Crear Cita </a> <a href=' . $comilla . route('datos.pacientes.edit', $pacientes->id) . $comilla . ' class=' . $comilla . 'btn btn-success btn-sm' . $comilla . ' data-toggle=' . $comilla . 'tooltip' . $comilla . ' title=' . $comilla . 'Editar Paciente' . $comilla . '><span class=' . $comilla . 'glyphicon glyphicon-pencil' . $comilla . '></span> Editar </a> <a href=' . $comilla . '#' . $comilla . ' data-id=' . $comilla . '' . $pacientes->id . '' . $comilla . ' onclick=' . $comilla . 'eliminar(' . $pacientes->id . ');' . $comilla . ' class=' . $comilla . 'btn btn-danger btn-delete btn-sm' . $comilla . ' data-toggle=' . $comilla . 'tooltip' . $comilla . ' title=' . $comilla . 'Eliminar' . $comilla . '><span class=' . $comilla . 'glyphicon glyphicon-remove' . $comilla . '></span> Eliminar </a>';
} else {
$url = '<a href=' . $comilla . URL::to('datos/citas/' . $pacientes->id) . $comilla . ' class=' . $comilla . 'btn btn-primary btn-sm' . $comilla . ' data-toggle=' . $comilla . 'tooltip' . $comilla . ' title=' . $comilla . 'Crear Cita' . $comilla . '><span class=' . $comilla . 'glyphicon glyphicon-list-alt' . $comilla . '></span> Crear Cita </a> <a href=' . $comilla . route('datos.pacientes.edit', $pacientes->id) . $comilla . ' class=' . $comilla . 'btn btn-success btn-sm' . $comilla . ' data-toggle=' . $comilla . 'tooltip' . $comilla . ' title=' . $comilla . 'Editar Paciente' . $comilla . '><span class=' . $comilla . 'glyphicon glyphicon-pencil' . $comilla . '></span> Editar Paciente </a>';
}
$data[] = array('num' => $n, 'name' => $pacientes->primer_nombre . ' ' . $pacientes->segundo_nombre . ' ' . $pacientes->apellido_paterno . ' ' . $pacientes->apellido_materno, 'cedula' => $pacientes->cedula, 'date' => $pacientes->fecha_nacimiento, 'cel' => $pacientes->celular, 'tel' => $pacientes->telefono, 'email' => $pacientes->email, 'cita' => $cant_citas, 'url' => $url);
$n++;
}
return Response::json(array('total' => $cantidad, 'rows' => $data));
} else {
App::abort(403);
}
}
示例2: cancel
public function cancel(WorkflowProgress $wp)
{
$c = Page::getByID($this->getRequestedPageID());
$wpr = new WorkflowProgressResponse();
$wpr->setWorkflowProgressResponseURL(\URL::to($c));
return $wpr;
}
示例3: pdf
public function pdf($id)
{
$hashId = \Jamesy\Miscellaneous::encryptId($id);
$pdf = new SimpleHTMLToPDF();
$link = URL::to('email/show/' . $hashId);
$pdf->display($link);
}
示例4: getDatatable
public function getDatatable()
{
$products = $this->ProductRepo->find(Input::get('sSearch'));
return Datatable::query($products)->addColumn('checkbox', function ($model) {
return '<input type="checkbox" name="ids[]" value="' . $model->public_id . '">';
})->addColumn('product_key', function ($model) {
return link_to('products/' . $model->public_id, $model->product_key);
})->addColumn('notes', function ($model) {
return nl2br(Str::limit($model->notes, 50));
})->addColumn('cost', function ($model) {
return Utils::formatMoney($model->cost, 1);
})->addColumn('name', function ($model) {
return nl2br($model->category_name);
})->addColumn('dropdown', function ($model) {
return '<div class="btn-group tr-action" style="visibility:hidden;">
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
' . trans('texts.select') . ' <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="' . URL::to('products/' . $model->public_id) . '/edit">' . uctrans('texts.edit_product') . '</a></li>
<li class="divider"></li>
<li><a href="' . URL::to('products/' . $model->public_id) . '/archive">' . uctrans('texts.delete_product') . '</a></li>
</ul>
</div>';
})->make();
}
示例5: index
public function index()
{
$raw = new Webtools\Raw\Raw('list', false, $this);
$raw->setTable('raw_actor');
$raw->order('last_update', 'asc');
$raw->unsetOptions(array());
$raw->setTitle('Actors');
$raw->fields(array('actor_id' => array('type' => 'hidden', 'primary_key' => true, 'column' => true), 'first_name' => array('column' => true, 'title_key' => true), 'last_name' => array('column' => true), 'last_update' => array('column' => true, 'readonly' => true, 'title' => 'Date')));
$this->data['raw'] = $raw;
$raw->render();
$this->data['raw_output'] = '
<div class="jumbotron">
<h1>Welcome to Raw!</h1>
<p>A CRUD package for Laravel inspired by the Grocery CRUD library for Codeigniter</p>
<p>Take a look at the examples below</p>
</div>
<div class="row">
<div class="col-md-12">
<ul class="list-group">
<li class="list-group-item"><a href="' . URL::to('raw_items/actors') . '">Actors</a></li>
<li class="list-group-item"><a href="' . URL::to('raw_items/customers') . '">Customers</a></li>
<li class="list-group-item"><a href="' . URL::to('raw_items/films') . '">Films</a></li>
<li class="list-group-item"><a href="' . URL::to('raw_items/languages') . '">Languages</a></li>
<li class="list-group-item"><a href="' . URL::to('raw_items/countries') . '">Countries</a></li>
<li class="list-group-item"><a href="' . URL::to('raw_items/rental') . '">Rentals</a></li>
<li class="list-group-item"><a href="' . URL::to('raw_items/payment') . '">Payment</a></li>
</ul>
</div>
</div>';
/* ADD template */
$this->layout = View::make($this->layout, $this->data);
}
示例6: search
public function search(Entity $entity)
{
$this->entryList = new EntryList($entity);
$this->entity = $entity;
$set = $this->entity->getResultColumnSet();
if ($set) {
$defaultSortColumn = $set->getDefaultSortColumn();
if ($this->request->query->has($this->entryList->getQuerySortDirectionParameter())) {
$direction = $this->request->query->get($this->entryList->getQuerySortDirectionParameter());
} else {
$direction = $defaultSortColumn->getColumnDefaultSortDirection();
}
if ($this->request->query->has($this->entryList->getQuerySortColumnParameter())) {
$value = $this->request->query->get($this->entryList->getQuerySortColumnParameter());
$column = $this->entity->getResultColumnSet();
$value = $column->getColumnByKey($value);
if (is_object($value)) {
$this->entryList->sanitizedSortBy($value->getColumnKey(), $direction);
}
} else {
$this->entryList->sanitizedSortBy($defaultSortColumn->getColumnKey(), $direction);
}
$result = new Result($this->entity->getResultColumnSet(), $this->entryList, \URL::to('/ccm/system/search/express/entries/submit', $this->entity->getID()));
$this->result = $result;
}
}
示例7: reset_password
public function reset_password($reset, $id, $da_mail = 1)
{
$reset = Input::has('reset') ? Input::get('reset') : $reset;
$id = Input::has('id') ? Input::get('id') : $id;
$da_mail = Input::has('da_mail') ? Input::get('da_mail') : $da_mail;
$new_password = Input::has('new_password') ? Input::get('new_password') : null;
$data = array('reset' => $reset, 'id' => $id, 'da_mail' => $da_mail, 'new_password' => $new_password);
$rules = array('reset' => 'required', 'new_password' => 'required');
$messages = array('newPassword.required' => 'Specifica una nuova password');
$validator = Validator::make($data, $rules, $messages);
$user = Sentry::findUserById($id);
if ($validator->passes()) {
try {
$user = Sentry::findUserById($id);
if ($user->checkResetPasswordCode($reset)) {
if ($user->attemptResetPassword($reset, $new_password)) {
return $this->make_response($data, false, array('Password resettata con successo'), URL::to('/'));
} else {
return $this->make_response($data, true, array('Non è stato possibile resettare la password'));
}
} else {
return $this->make_response($data, true, array('Reset code non valido'));
}
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
return $this->make_response($data, true, array('Utente non trovato'));
}
}
if (!$da_mail) {
$errors = $validator->messages;
return $this->make_response($data, true, $errors);
}
return View::make('login_reset_password')->with('reset', $reset)->with('id', $id)->with('da_mail', $da_mail)->with('args', $this->args);
}
示例8: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
// create new sitemap object
$sitemap = App::make("sitemap");
$today = '2014-11-01T12:30:00+02:00';
// set cache (key (string), duration in minutes (Carbon|Datetime|int), turn on/off (boolean))
// by default cache is disabled
// $sitemap->setCache('laravel.sitemap', 1);
// add item to the sitemap (url, date, priority, freq)
$sitemap->add(URL::to('/'), $today, '1.0', 'daily');
$sitemap->add(URL::to('about'), $today, '0.8', 'monthly');
$sitemap->add(URL::to('category/all'), $today, '0.8', 'monthly');
$sitemap->add(URL::to('category/web'), $today, '0.8', 'monthly');
$sitemap->add(URL::to('category/olm'), $today, '0.8', 'weekly');
$sitemap->add(URL::to('category/games'), $today, '0.8', 'weekly');
$data = Category::get_items('all', true);
$entries = $data['json']['entries'];
foreach ($entries as $item) {
$o = (array) $item['entry'];
$client_key = $o['client_key'];
$entry_key = $o['entry_key'];
$to = "item/" . $client_key . "/" . $entry_key;
$sitemap->add(URL::to($to), $today, '0.9', 'weekly');
}
// show your sitemap (options: 'xml' (default), 'html', 'txt', 'ror-rss', 'ror-rdf')
$sitemap->store('xml', 'sitemap');
return $sitemap->render('xml');
}
示例9: getIndex
public function getIndex()
{
$this->heads = array(array('Role', array('search' => true, 'sort' => false, 'select' => Prefs::getRole()->RoleToSelection('_id', 'rolename'))), array('Created', array('search' => true, 'sort' => true, 'date' => true)), array('Last Update', array('search' => true, 'sort' => true, 'date' => true)));
//print $this->model->where('docFormat','picture')->get()->toJSON();
Breadcrumbs::addCrumb('System', URL::to(strtolower($this->controller_name)));
return parent::getIndex();
}
示例10: update
public function update()
{
$btn_sta = Input::get('btn_sta');
$inputs = Input::get('check');
$idRed = Input::get('project_id');
switch ($btn_sta[0]) {
case 1:
foreach ($inputs as $key => $id) {
DB::table('project_logs')->where('id', $id)->delete();
}
Session::flash('flash_message', "Sukses Menghapus Data !!");
break;
case 2:
foreach ($inputs as $key => $id) {
DB::table('project_logs')->where('id', $id)->update(['status' => "Done"]);
}
Session::flash('flash_message', "Sukses Memperbaharui Status !!");
break;
case 3:
foreach ($inputs as $key => $id) {
DB::table('project_logs')->where('id', $id)->update(['status' => "Undone"]);
}
Session::flash('flash_message', "Sukses Memperbaharui Status !!");
break;
default:
break;
}
return redirect(\URL::to('project/detail', encrypt($idRed)));
}
示例11: upload
public function upload(Request $request)
{
if ($request->hasFile('file')) {
$path = $this->getStorageRoot() . $request->get('directory');
$dir = $request->get('directory');
$filename = $request->get('filename') != '' ? $request->get('filename') : $request->file('file')->getClientOriginalName();
$result = new \stdClass();
$result->name = $filename;
$result->directory = $dir;
$result->path = '/' . $dir . '/' . $filename;
$result->fullPath = \URL::to($dir) . '/' . $filename;
$result->backgroundImage = "url('{$result->path}')";
$result->active = false;
$request->file('file')->move($path, $filename);
// if a model has been assigne dto be updated
if ($request->has('model')) {
$modelData = json_decode($request->get('model'));
$model = new $modelData->modelName();
$model::updateOrCreate(['id' => $modelData->modelId], [$modelData->modelField => $modelData->modelValue]);
$result->model = $model;
}
return response()->json($result);
}
return response()->json(['No image uploaded']);
}
示例12: __toString
public function __toString()
{
if (is_object($this->file)) {
return (string) \URL::to('/download_file', $this->file->getFileID());
}
return '';
}
示例13: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (\Auth::user()->hak_akses == 1) {
return $next($request);
}
return redirect(\URL::to('error'));
}
示例14: post_upload
public function post_upload()
{
// fetch input data
$input = \Input::all();
// create rules for validator
$rules = array('image' => 'required|image|max:5000', 'description' => 'required|max:100');
// validate the data with set rules
$v = \Validator::make($input, $rules);
if ($v->fails()) {
// if validation fails, redirect back with relevant error messages
return \Redirect::back()->withInput()->withErrors($v);
} else {
$image = \Input::file('image');
// URL::to('/') can be changed to public_path() on a public domain
$directory = \URL::to('/') . '/uploads/';
$mkdir = public_path() . '/uploads/';
// create directory if it doesn't exist
if (!file_exists($mkdir)) {
\File::makeDirectory($mkdir, 0775, true);
}
// save the filename with the path and a unique name for the file
$filename = uniqid() . '.' . $input['image']->getClientOriginalExtension();
// move the file to the correct path
$upload_success = $input['image']->move($mkdir, $filename);
$full_path = $directory . $filename;
// store image info in the database
\DB::table('images')->insert(['description' => \Input::get('description'), 'image' => $full_path, 'user_id' => \Auth::user()->id, 'approved' => 0, 'created_at' => \Carbon\Carbon::now()->toDateTimeString()]);
return \Redirect::back()->withInput()->withErrors('Upload Successful!');
}
}
示例15: sendResetEmail
function sendResetEmail($user)
{
$confirmation_code = str_random(30);
DB::table('password_resets')->insert(array('email' => $user->email, 'token' => $confirmation_code, 'created_at' => date('Y-m-d h:i:s')));
$link = \URL::to('system/reset-password') . '/' . $confirmation_code . " ";
$mail = \EX::sendEmail($user->email, $user->fullname, 'forgot_password', ['{{RESET_URL}}' => $link, '{{ USERNAME }}' => $user->fullname, '{{ NAME }}' => $user->fullname]);
}