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

TOPIC:

Where to place custom code? 01 Sep 2013 18:03 #10936

I have a question regarding customizing the code when an item is created. In short, where to put it?


com_thing
> admin
>> models
>>> foo.php
>>> fooitem.php

So I would assume that I put my custom code here when creating a NEW item, but where?

com_thing
> admin
>> fork
>>> models
>>> fooitem.php

Is this the right file? If so, under what function?

prepareQuery() ?
prepareTable() ?

I have been looking at each of them and testing, but I can't seem to get it right.
--
Jerry Benton

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

Where to place custom code? 01 Sep 2013 18:12 #10937

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
Yes, in the fork folder.
Just copy the function you want to change into the fork/models/the_name_of_the_file.php
depends on what you want to do.
The following user(s) said Thank You: admin

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

Where to place custom code? 01 Sep 2013 18:19 #10938

So the "item" file? (The default j-cook uses when creating an item view.)

I can't seem to get my code to fire off when creating a new item. I have even tried just a simple "echo 'HIT';" when the code block is encountered.
--
Jerry Benton

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

Where to place custom code? 01 Sep 2013 18:29 #10939

I think I got it :)

Thanks.
--
Jerry Benton

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

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

Hi first of all I'd like to say that J-Cook is a great tool - the best component builder I tried so far...
Rymedia - Jonas 

Get Started