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.214 seconds

This is what you call a component builder. I was able to master using this in a very short time and the resulting component works like a charm. Not just a basic component builder but a fully working component builder with forms fields tables all ready to go. You can make the list and item views to display in the front and back end. Also there is a great forum just starting to evolve and I'm sure this will grow very rapidly when you all realise how good this tool is.
Kevin (JED)

         

Get Started