Welcome Guest, Not a member yet? Register   Sign In
groceryCRUD version 0.8
#11

[eluser]web-johnny[/eluser]
hope this example will help :-)
Relation-1-1 (user guide)
#12

[eluser]kimy_cool[/eluser]
The My_Output.php posted here now works very well on Windows but the earlier My_Output.php works well in Linux.

I have the below function working very well. In this table i have a column called description(TEXT) where when adding a description, i want a way the first 20 words from description are formatted (strip special characters) and inserted in a column called except(TEXT) in the same table. How can i have this in this function or do i have to write a new function to achieve this?

Code:
function codes()
    {
        $this->crud->set_table('codes');        
        $this->crud->set_operations(array('add','edit','delete'));
        $this->crud->get();
    }

This CRUD is very well done!

-K
#13

[eluser]web-johnny[/eluser]
Actually for this you need a callback and I am still working on callbacks. I could say to you a way to do it, but it will confused you even more!!! But if you need to do this - I can write another post for it. Just tell me
#14

[eluser]kimy_cool[/eluser]
Thank you web-jonny, if you have sometime, please post a way to accomplish this. Also on the templates/ i have developed my own template and some of the challenges i had to overcome was a way to use my own css, headers n footers. Maybe you can have a short tutorial/howto one can use own templates/. Also on the views/ there are many template views which am not sure what they ought to accomplish. Are you working on a Auth system since there are some login views in /views folder?

I have selected your CRUD for my custom CMS for travel companies and i guess I can post as many experiences am having with groceryCRUD to make it stable and extensible. What do you think?

-K
#15

[eluser]web-johnny[/eluser]
To change the default template you can go to /templates/backend/simple/template.php and just add to the header the css . To be more organized you can put it to the /templates/backend/simple/css/ folder. The same thing you can do it with the js to the folder /templates/backend/simple/js/. I first want to write a documentation for my Crud and after from the Template Controller.

For the other thing that you asked , when I will find time I will post you the code(I will tested too). Thank you for your support :-)
#16

[eluser]KarlBallard[/eluser]
This will save me a lot of simple in my admin end of the site. Just out of curiosity before I download, this the view that is produced in an iframe like the demos, or did you just put the examples in iframes?
#17

[eluser]web-johnny[/eluser]
With those few line of codes you create all the crud that you just see. Its a package that you copy it to your codeigniter project. All the examples are in the controller examples.php so you will not have any problem. Actually I just realized that the example_9 is missing! I will update that ASAP.
#18

[eluser]NeoArc[/eluser]
I like this plugin! Thanks.

Hmm, can you add more than one relationship? It seems than only the last one works.
#19

[eluser]web-johnny[/eluser]
Yes of course you can. You can add as many as you want. If 3 fields have relationship, you can add 3 relations. Try it ;-)
#20

[eluser]web-johnny[/eluser]
[quote author="kimy_cool" date="1295349084"]The My_Output.php posted here now works very well on Windows but the earlier My_Output.php works well in Linux.

I have the below function working very well. In this table i have a column called description(TEXT) where when adding a description, i want a way the first 20 words from description are formatted (strip special characters) and inserted in a column called except(TEXT) in the same table. How can i have this in this function or do i have to write a new function to achieve this?

Code:
function codes()
    {
        $this->crud->set_table('codes');        
        $this->crud->set_operations(array('add','edit','delete'));
        $this->crud->get();
    }

This CRUD is very well done!

-K[/quote]

here is your answer :-). Its tested that it works. But you first need to donwload the file: crud.php and replace your crud.php file. In your case it is on C:\xampp\htdocs\CI\system\application\libraries\crud.php . I'm working with callbacks. I am still working on it, that's why I don't have it in my version 0.8. Still want to write some documentation when I have time.

Code:
function codes()
    {
        $this->crud->set_table('codes');
        $this->crud->set_subject('Code');
        
        $this->crud->set_fields('description');
        $this->crud->callback_after_add(array($this,'add_except'));
        $this->crud->callback_after_edit(array($this,'add_except'));
        
        $this->crud->set_operations(array('add','edit','delete'));
        $this->crud->get();
    }
    
    function add_except($my_id, $post_array)
    {
        $this->load->helper('text');
        $this->db->update('codes',array('except' => word_limiter(strip_tags($post_array['description']),20)),array('id' => $my_id));
    }




Theme © iAndrew 2016 - Forum software by © MyBB