Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

fork on model 20 Mar 2014 15:15 #12317

  • albert
  • albert's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 70
  • Thank you received: 2
Hi i did a component

on the model i have models/experiment_type.php
class RmnmanagementCkModelExperimenttype extends RmnmanagementClassModelList
{
.....
code
....
protected function prepareQuery(&$query)
{
... code ...
}

...
}

I want to make some changes, thus i go to _fork/models/experiment_type.php
class RmnmanagementModelExperimenttype extends RmnmanagementCkModelExperimenttype
{

/**
* Preparation of the list query.
*
* @access protected
* @param object &$query returns a filled query object.
* @return void
*/
protected function prepareQuery(&$query)
{
echo 'a';die;
}
}

and it does nothing !!
why??

Please Log in or Create an account to join the conversation.

fork on model 21 Mar 2014 19:42 #12332

Did you copy the model from the _fork directory to the fork directory?

Please Log in or Create an account to join the conversation.

fork on model 21 Mar 2014 19:43 #12333

  • albert
  • albert's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 70
  • Thank you received: 2
i just copied the function

protected function prepareQuery(&$query)
{
echo 'a';die;
}

Please Log in or Create an account to join the conversation.

fork on model 21 Mar 2014 23:02 #12338

Sorry, I wasn't very clear

The file experiment_type.php needs to be in the directory fork/models, i.e. copy it from _fork

_fork contains the base files for forking but that directory is not used at runtime, the fork directory is where the code looks for overrides

Dave

Please Log in or Create an account to join the conversation.

fork on model 22 Mar 2014 09:20 #12342

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Documentation for the forks :
www.j-cook.pro/index.php/f/forks

Also, you must respect the fork location (front or back)
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.064 seconds

Just wanted to congratulate you on the J-Cook website / web development tool. In a couple of visits I've had a play around with Cook and have to say I think it is fantastic.  I've played with a number of component builders in the past and yours is certainly looking like the best so far. I'd also like to help you spread the word - I'm really surprised more people aren't excited about this tool. Good luck with the project.
Dean

Get Started