problem about kohana-3.2-Collection of common programming errors


  • Aaron A
    kohana-3 kohana-orm kohana-3.2
    I have a model named permission. Permission has many roles permission has many users permission has many denied usersBelow is from the permissions model:protected $_has_many = array(‘user’ => array(‘through’ => ‘user_permission’),’permissiondeny’ => array(‘model’ => ‘user’, ‘through’ => ‘user_permissiondeny’,’foreign_key’ => ‘permissiondeny_id’),’role’ => array(‘through’ => ‘role_permission’), );The user and role relationships work as expected. I can select the deny perm

  • Emilie
    phpunit kohana-3.2
    I’m having trouble correctly setting up unit testing in Kohana 3.2.I installed PHPUnit. I changed the bootstrap to activate Kohana’s unittest module. I also changed the index.php file to look like this:if ( ! defined(‘SUPPRESS_REQUEST’)) {echo Request::factory()->execute()->send_headers()->body(); }I created a folder tests in my application folder. In it, I inserted a phpunit.xml file that looks like this:<phpunit colors=”true” bootstrap=”../../index.php”> <testsuites><

  • Tarek
    kohana kohana-3.2
    I’m trying to add simple links in kohana inside a view inside a loop .Here is the code i have :echo HTML::anchor(Route::get(‘parent’)->uri(array(‘id’ => $parent->id)), HTML::chars($parent->email))Now this return a link to root becauseRoute::get(‘parent’)->uri(array(‘id’ => $parent->id)returns an empty string .Now if If i modify my Route::get to :Route::get(‘parent’)->uri(array(‘controller’ => ‘parent’ , ‘action’ => ‘index’ , ‘id’ => $parent->id))

  • Victor Czechov
    kohana kohana-3.2 query-builder
    I need to INSERT a data to table, but before a query I must to know the MAX value from column position, than to INSERT a data WHERE my SELECTED before position+1. Is it possible with query builder?following my first comment I did query:$p = DB::select(array(DB::expr(‘MAX(`position`)’, ‘p’)))->from(‘supercategories’)->execute();echo $p;the error:ErrorException [ Notice ]: Undefined offset: 1MODPATH\database\classes\kohana\database.php [ 505 ]500 */ 501 public function quote_column

  • witzawitz
    unit-testing phpunit kohana cli kohana-3.2
    I’ve configured kohana (3.2) unittest module as described here. So I have:APPPATH/tests/phpunit.xmlsampletest.phpAnd last lines index.php file:require APPPATH.’bootstrap’.EXT; if ( ! defined(‘SUPPRESS_REQUEST’))Request::factory()->execute()->send_headers();So the first problem is that in CLI next error appears:ErrorException [ 8 ]: Undefined index: SERVER_NAME ~ SYSPATH/classes/kohana/url.php [ 79 ]This happens because of E_STRICT enabled. So when I turn off E_STRICT nothing happens. I mea

  • qiao
    orm kohana kohana-3.2
    I trying to make many-to-many relation between 2 models: Users_Role and Users_Rightclass Model_Users_Role extends ORM{protected $_has_many = array(‘rights’ => array(‘model’ => ‘users_right’,’through’ => ‘users_roles_rights’,),); }class Model_Users_Right extends ORM{ protected $_has_many = array(‘roles’ => array(‘model’ => ‘users_role’,’through’ => ‘users_roles_rights’,),); }I’m trying to do this: $role = ORM::factory(‘users_role’, 1); $right = ORM::factory(‘users_right’

  • hakre
    php exception-handling kohana kohana-3.2
    I have been looking around and following each tutorials,there is one which stands out. http://blog.lysender.com/2011/02/kohana-3-1-migration-custom-error-pages/ <– i followed this tutorial and everything went smoothlythe error is being detected the exception is being handledbut there has been an exception that i cant seem to find. im currently having this exceptionFatal error: Exception thrown without a stack frame in Unknown on line 0all of my codes are thesame to the site-link. please help

Originally posted 2013-11-26 05:55:38.