• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeExtinguisher 2.0 Release Candidate 14.2

[eluser]damarev[/eluser]
Yeah!

Code:
for(var i=0; i<100; i++)
{
   echo 'THX!';
}

[eluser]spyro[/eluser]
[quote author="spyro" date="1228813541"]primary_id doesn't seem to work unless it is under form_setup.

With your suggestion it puts me back to the SQL error.[/quote]

Is anyone else seeing this issue?

[eluser]jazbek[/eluser]
Hi guys,

Just starting out with Code Extinguisher and am really grateful for all the time it's saved me. I got my basic forms set up very quickly and am now just stuck on one small detail.

I deleted the 'example' table from my database and would like to display a different table by default when a user logs in. I tried changing all the references in the example.php controller to my new table, but cannot seem to get around various mysql and php errors. Can someone describe the exact steps that would be required to remove all references to the example table? I've been successful deleting it from the left navigation and all that's left is for CE to load a different table on login.

Cheers, and thanks JTaby for this awesome package.

[eluser]Majd Taby[/eluser]
make sure you change the default_controller, also, look in codex.php under the config/ directory

[eluser]jazbek[/eluser]
I figured out the problem. I had set up a YAML file for my pages table (which is the one that I want to load by default), and that YAML file had all the directives set inside it. However, the example.php controller was loading a YAML file for only the form_setup directive, so when I replaced the file name with my pages YAML file, it was causing a php error.

I figured out a strange way to load some of the directives in a php array and some in a yaml file:

Code:
class Pages extends codexController
{
    function Pages ()
    {
        // Load the CodexController
        codexController::codexController();
        $config = array(
            'db_table' => 'pages', //The name of the table associated with this controller
            'controller_name' => 'Pages', //The name of the controller, so that it can be used when generating the URLs
        );
        $this->setConfig(array_merge($config, $this->spyc->YAMLLOAD($this->codexadmin->getDefinitionFileName('pages'))));
    }
}

...for some reason it wasn't letting me specify db_table and controller_name in the yaml file (I was getting a spyc error). Is there any way to put all these settings in the yaml file or do I have to do it this way?

Thanks!

[eluser]Majd Taby[/eluser]
Make sure you don't use tabs in your YAML file, only spaces.

Use this as a template:

Code:
db_table: pages
controller_name: Pages
display_fields:
    -file_number
    -business
    -location
    -gross_sales
    -featured
    -pending
    -sold
order_by: file_number
order_type: desc
form_setup:
    image:
        class: File
        params:
            upload_path: /path/goes/here/
            url_path: uploads/dir/
            make_thumbnail: true
            width:300
            height:200
    file_number:
        class: TextBox
    business:
        class: TextBox
    location:
        class: TextBox

Let me know if it worked.

[eluser]jazbek[/eluser]
[quote author="Majd Taby" date="1231335825"]Let me know if it worked.[/quote]

it totally worked, thank you. i wasn't using tabs, but maybe i had my indenting wrong in some other way. i really appreciate all your help. Smile

[eluser]jazbek[/eluser]
2 more questions:

- The add_link directive isn't working for me (maybe it's not implemented in the latest CE version, i realize the docs are outdated). Is there any way I can specify that string?

- My table rows contain content pages for a website. Is there any way to display a shortened version of the text on the overview page, instead of the entire content? I know I could just hide that field, but I'd like to display like the first 20 words or so if possible.

Thanks again. Smile

[eluser]Majd Taby[/eluser]
I'll have to look into your first issue

as for the second...I suggest making/modifying a plugin and changing the prepForDisplay function.

[eluser]jazbek[/eluser]
Great, thank you.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.