kohana

Kohana_Exception [ 0 ]: A valid cookie salt is required. Please set Cookie::$salt

只谈情不闲聊 提交于 2019-12-05 13:14:37
I'm working through this tutorial ( http://kowsercse.com/2011/09/04/kohana-tutorial-beginners/ ) and have run into this error message: Kohana_Exception [ 0 ]: A valid cookie salt is required. Please set Cookie::$salt. I'm a n00b and don't even know where to look for Cookie::$salt in the app. You have to provide a salt as you can read in the official documentation //bootstrap.php Cookie::$salt = 'foobar'; I can highly recommend the official doc as well as the API browser . When you learn how Kohana works, you will learn first of all the meaning of the error messages and how you can handle them

approach for “site down for maintenance”

假装没事ソ 提交于 2019-12-05 10:26:26
I have been using Joomla and I love its administrative facility to put the site down for maintenance. As I have seen, all requests to the site if it is in maintenance mode is routed to a single page. If I want to add my own "site down for maintenance" module for a non-Joomla site, how do I do this? I am using an MVC framework in PHP called Kohana in its version 2 which is similar with Codeigniter. I have a Router class where I can control where a certain address go. The only approach I can think is redirect every request to a particular controller function when site is down, but how do I do

Are there any example projects that use Kohana with user registration and login authentification?

☆樱花仙子☆ 提交于 2019-12-05 09:40:51
I want to make an web application (platform) that does pretty straightforward stuff: Users can register, get an account, and therefore login on to the platform. I've installed Kohana. It would be cool to have a lightweight demo-project that makes use of these things in order to see how it's done. Are there any good ones available? Gallery3 Beta and Argentum Invoice are both built on Kohana and have authentication. A ready to download example based on kohana 3.2. http://www.workinprogress.ca/kohana32/ bumperbox The auth module that comes bundled with Kohana allows you to manager simple user

Kohana 3.2: Custom error message for a custom validation rule?

无人久伴 提交于 2019-12-05 09:20:33
问题 I am using a custom method for a validation rule in my model (using Kohana 3.2). I am following the format listed on the documentation. // Calls A_Class::a_method($value); array(array('A_Class', 'a_method')), But I can't seem to figure out how to add a custom error message if the rule fails. Any help? 回答1: For this example we will assume a modal "user" and validating the field "username" /application/classes/model/user.php class Model_User extends ORM { public function rules() { return array(

Can I Use MySQLi and PHP5 Syntax Within CodeIgniter?

梦想的初衷 提交于 2019-12-05 02:48:22
问题 Im starting a new web project, and I figured I'd try using a framework. I know CodeIgniter is coded in PHP4, but will I be able to use the MySQLi functions of MySQL, as well as PHP5 syntax (when it comes to OO especially) while coding with CodeIgniter? Should I use Kohana instead? 回答1: Yes. You can use whatever features in the version of PHP that you are running. Codeigniter runs fine on PHP5. Also, Codeigniter includes a database driver for mysqli which can be set in system/application

How to implement SimpleTest in Kohana

蹲街弑〆低调 提交于 2019-12-05 01:52:06
问题 My boss assigned me to learn how to use Kohana and implement simple test in that. We would like to use it as our framework for future projects. Being new to both KohanaPHP and SimpleTest, I can't figure out how to do even the simplest test of my helpers. I can't even find a single step-by-step tutorial on how to attach SimpleTest to Kohana. Anyone here have an idea? 回答1: We've created a SimpleTest_controller in Kohana and it gets the test from a directory tests define ( 'SIMPLE_TEST', '..

Is it possible to re-use a Kohana ORM query for the row count?

六眼飞鱼酱① 提交于 2019-12-05 00:32:03
问题 So I have my query as so... $records = ORM::factory('category'); Add a WHERE clause as so... $records = $records->where('categoryid', 'LIKE', 'aa'); Grab a count for pagination as so... $count = $records->count_all(); And my where clause gets cleared away as so... SELECT `categories`.* FROM `categories` LIMIT 20 OFFSET 0 With this line commented out //$count = $records->count_all(); My SQL looks just fine... SELECT `categories`.* FROM `categories` WHERE `categoryid` LIKE 'aa' LIMIT 20 OFFSET

Need assistance with Kohana 3 and catch all route turning into a 404 error

拜拜、爱过 提交于 2019-12-04 20:47:51
Based on this documentation , I've implemented a catch all route which routes to an error page. Here is the last route in my bootstrap.php Route::set('default', '<path>', array('path' => '.+')) ->defaults(array( 'controller' => 'errors', 'action' => '404', )); However I keep getting this exception thrown when I try and go to a non existent page Kohana_Exception [ 0 ]: Required route parameter not passed: path If I make the <path> segment optional (i.e. wrap it in parenthesis) then it just seems to load the home route, which is... Route::set('home', '') ->defaults(array( 'controller' => 'home',

kohana 3 uploading image without using any modules?

风格不统一 提交于 2019-12-04 20:38:53
does anybody have an example of uploading images in kohana 3 without using any modules eventually ? i used https://github.com/kohana/image/tree/3.1%2Fmaster but my error is: Fatal error: Uncaught Kohana_Exception [ 0 ]: Installed GD does not support images is there any easy and fast way to upload files in a kohana 3 based website? thanks! Kohana API should help. Basic steps are: Create Validation object ( $array = Validation::factory($_FILES); ) Define rules ( $array->rule('file', 'Upload::not_empty')->rule('file', 'Upload::type', array(array('jpg', 'png', 'gif'))); ) Check file(s) ( if (

Translating Kohana-modules in a convenient way?

我的梦境 提交于 2019-12-04 19:44:24
I have been looking for a convenient way of making and maintaining translations of my Kohana-modules. I have played around with POEdit and have extracted all __()'s from my modules. Really like the way POedit works, and it's just to run a quick update to gather all new strings and save a new catalog later on. I could afterwards convert the po-files to PHP-arrays sort of...it seems a bit complicated with all steps. I have seen this approach but I would rather not install tables and new modules for translations, I think this gets to complicated and "drupalish" ;-). How do you managing