Kohana (yanı sıra CodeIgniter ve diğer çerçeveler çoğu) dayanır bunu derinden kesmek sürece Front-Controller Pattern (index.php
) yani ben bunu güvenmek gerekmez nasıl göremiyorum .
form::open()
kaynağında hızlı bir görünüm sonra:
public static function open($action = NULL, array $attributes = NULL)
{
if ($action === NULL)
{
// Use the current URI
$action = Request::instance()->uri;
}
if ($action === '')
{
// Use only the base URI
$action = Kohana::$base_url;
}
elseif (strpos($action, '://') === FALSE)
{
// Make the URI absolute
$action = URL::site($action);
}
// ...
}
Ben bir mutlak URL belirtmeden mümkün olduğunu sanmıyorum. Eğer yapıyor sakıncası yoksa bir çözüm olabilir:
form::open('http://domain.com/my-site/bla');
Aksi takdirde iyi yaklaşım str_replace()
or override the it with an application helper olacaktır.
If you edit the url
yardımcı (/system/classes/kohana/url.php
) ve bu gelen değişiklik satırı 71: strong>
return URL::base(TRUE, $protocol).$path.$query.$fragment;
Buna:
return URL::base(FALSE, $protocol).$path.$query.$fragment;
All index.php
görünüşe gitmiş olmalıdır. Strong>
Ben bu işe eğer emin değilim, ama içinde application/bootstrap.php
Bu değiştirin:
Kohana::init(array('base_url' => '/kohana/'));
Buna:
Kohana::init(array('base_url' => '/kohana/', 'index_file' => ''));