kohana-3

Kohana 3 Routing and Query Strings

久未见 提交于 2019-12-13 18:22:43
问题 If I have a route like this: Route::set('test', 'test') ->defaults(array( 'controller' => 'test', 'action' => 'index' )); I assumed that only the url mysite.com/test or mysite.com/test/ would be sent to this route and anything else would be sent to the default route, or a catch all route if you have one. However, you can tack on any query strings and it will still be valid. For example any of these would work: mysite.com/test/?abc mysite.com/test/?abc=123 mysite.com/test/?abc=123&blabla=lala

Kohana 3 Auth in IE

↘锁芯ラ 提交于 2019-12-13 08:45:18
问题 I'm finding I can't log in to my Kohana site through IE. (just IE, works fine everywhere else) It's validating, so much as, it knows if you get your username and password wrong, but its not creating the session. I've added to: application/config/session.php <?php return array( 'cookie' => array( 'name' => 'session_cookie', 'encrypted' => TRUE, 'lifetime' => 43200, ), 'native' => array( 'name' => 'session_native', 'encrypted' => TRUE, 'lifetime' => 43200, ), 'database' => array( 'name' =>

Kohana 3.2 Route - controllers in subdirectories

霸气de小男生 提交于 2019-12-13 05:21:07
问题 I need to create next structure: +controller ++admin +++catalog ++++category.php ++++product.php +++users and I need to open them by url /admin/catalog/category/action/param I tried to create route: Route::set('admin', '(<directory>(/<controller>(/<action>(/<custom_param>))))',array( 'directory' => '(admin/.*)' )) ->defaults(array( 'controller' => 'dashboard', 'action' => 'index' )); 回答1: Not tested: Route::set('admin', 'admin/<directory>/(<controller>(/<action>(/<custom_param>)))', array(

KohanaException : Directory APPPATH\cache must be writable

試著忘記壹切 提交于 2019-12-12 02:40:53
问题 i am trying to run a project of kohana-3 in wamp server but getting following error Kohana_Exception [ 0 ]: Directory APPPATH\cache must be writable please help. Previously this was working fine. 回答1: You must set your cache folder to be writable. Bare in mind that usually in WAMP the PHP user is 'nobody' which doesn't have access to your folders, therefore you must set your folders to be writable. 回答2: Check whether the file actually exists (application/cache), this folder comes empty with

ERROR READING SESSION DATA in Kohana 3.2

此生再无相见时 提交于 2019-12-12 00:42:03
问题 I am having a problem with the session with the web development framework Kohana 3.2 that apparently is a bug that, at most, can be workarounded. It reports SESSION_EXCEPTION [ 1 ]: ERROR READING SESSION DATA. My Kohana application isn't in the root folder and I wonder if that has something to do with it. I have tryed several possible solutions but none of them have worked. Here are some of them: 1) using one library (Facebook SDK), session was initialized on it's own, and session handling

HTTP - 400 bad request while downloading file

只愿长相守 提交于 2019-12-11 23:52:55
问题 After further investigation on basis of previous question url encode/decode is working properly. Issue is something with Apache server (might be) which serves file download request Specially if my file name ends with % sign, it fails. For e.g. Original File name: 204153_20090605_Aluminiumacetotartraat_DCB_oordruppels_1,2%.pdf Url in browser after clicking on download link: http://pdf/204153_20090605_Aluminiumacetotartraat_DCB_oordruppels_1%2C2%25.pdf This returns 400 error with bad request. I

kohana v3: using different templates for different subdomains

∥☆過路亽.° 提交于 2019-12-11 13:04:00
问题 I have a kohana v3 app. 2 subdomains pointing to this app. what I have to setup that kohana uses a different template if the app called with subdomain2.example.com? at the moment all calls (from subdomain1 and subdomain2) use the standard template: 'templates/default' thank you! daniel 回答1: First, get the subdomain name from $_SERVER['SERVER_NAME'] : list($subdomain) = explode('.', $_SERVER['SERVER_NAME'], 2); Then choose what template to use based on the subdomain: // Replace this with a

How use custom libraries in Kohana 3

南笙酒味 提交于 2019-12-11 03:19:40
问题 I am trying to include a user library that includes some user related functions such as checking if the user is authenticated and such. Now I am trying to make usage of the Kohana autoloader, but can't seem to get it working. I have the library placed under application/classes/library class User { public function is_alive() { $session = Session::instance(); $data = $session->get('alive'); if(isset($data)) { return true; } else { return false; } } } And I try to call the library with $user =

How can I wrap PHP legacy code in Kohana?

一曲冷凌霜 提交于 2019-12-10 18:21:07
问题 I have a good amount of legacy code written in PHP, which was not written on any particular framework rather it is mostly old-school style (i.e. inline) PHP. However, most of my new code is written on the Kohana 3.1.X framework. Although Kohana does allow both legacy code and Kohana files to coexist on the same Web site, I would like to now wrap up each legacy code file as a view and take full advantage of Kohana's MVC design pattern and URL rewriting. Yet I am encountering problems with my

Kohana 3 Auto loading Models

 ̄綄美尐妖づ 提交于 2019-12-10 17:37:26
问题 I'm attempting to use a Model but I get a fatal error so I assume it doesn't autoload properly. ErrorException [ Fatal Error ]: Class 'Properties_Model' not found The offending controller line: $properties = new Properties_Model; The model: class Properties_Model extends Model { public function __construct() { parent::__construct(); } } I also put the class in three different locations hoping one would work, all there failed. They are: application/classes/model application/model application