Welcome Guest, Not a member yet? Register   Sign In
symfony style admin/backend generator
#5

[eluser]Majd Taby[/eluser]
You know what, I was thinking about it, it really isn't very useful to generate a whole backend for yourself automatically...that kinda goes against the whole philosophy of CI and is the reason I switched from Symfony to CI in the first place.

What I've been doing was create standalone libraries...so far i created one for simple, one level userauth, and another for formgeneration.

For form generation, here's the basic layout:

In you controller:

Code:
function edit(){
        $this->jtabyforms->initiate($this->spyc->YAMLLOAD('definitions/portal_form.yml'));
        $id = $this->uri->segment(3);
        echo $this->jtabyforms->getHTML();
    }

Then in the portal_form.yml config file:

Code:
title:
    class: TextBox
    label: Title
    attributes:
    value: Enter title here
date:
    class: TextBox
    label: Title
    attributes:
    value:
entry:
    class: TextArea
    label: Entry
    attributes:
        cols: 45
        rows: 10
    value:

The output of that code is:

Code:
<label for="title">
                Title
            </label>
            &lt;input type="text" value="Enter title here" name="title" /&gt;
        
            <label for="date">
                Title
            </label>
            &lt;input type="text" value="" name="date" /&gt;
        
            <label for="entry">

                Entry
            </label>
            &lt;textarea cols="45"rows="10"&gt;
                
            &lt;/textarea&gt;


Messages In This Thread
symfony style admin/backend generator - by El Forum - 09-22-2007, 08:28 PM
symfony style admin/backend generator - by El Forum - 09-23-2007, 03:27 AM
symfony style admin/backend generator - by El Forum - 09-23-2007, 07:20 AM
symfony style admin/backend generator - by El Forum - 09-27-2007, 01:29 PM
symfony style admin/backend generator - by El Forum - 09-28-2007, 03:48 PM
symfony style admin/backend generator - by El Forum - 09-28-2007, 04:32 PM
symfony style admin/backend generator - by El Forum - 09-28-2007, 04:42 PM
symfony style admin/backend generator - by El Forum - 09-28-2007, 05:02 PM
symfony style admin/backend generator - by El Forum - 09-28-2007, 05:39 PM
symfony style admin/backend generator - by El Forum - 01-09-2008, 04:07 PM
symfony style admin/backend generator - by El Forum - 01-09-2008, 04:46 PM
symfony style admin/backend generator - by El Forum - 01-10-2008, 01:45 AM
symfony style admin/backend generator - by El Forum - 01-10-2008, 07:31 AM
symfony style admin/backend generator - by El Forum - 01-10-2008, 11:57 AM
symfony style admin/backend generator - by El Forum - 01-10-2008, 01:12 PM
symfony style admin/backend generator - by El Forum - 01-10-2008, 01:48 PM
symfony style admin/backend generator - by El Forum - 01-11-2008, 12:15 PM
symfony style admin/backend generator - by El Forum - 01-26-2011, 09:11 AM
symfony style admin/backend generator - by El Forum - 01-26-2011, 10:15 AM
symfony style admin/backend generator - by El Forum - 01-26-2011, 11:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB