Welcome Guest, Not a member yet? Register   Sign In
Yats and scaffolding
#1

[eluser]Jose Dueñas[/eluser]
Hi folks!
I'm having some problems with scaffolding and yats.

I have my controller like that:
Code:
<?php

class Inmo extends Controller
{
    function Inmo()
    {
        parent::Controller();
        $this->load->scaffolding('properties_sale');
    }    
    
    function index()
    {
        // Set the template valiables
        $data['mensaje'] = "A Message";

        // Build the thing
        $this->layout->buildPage('inmo/home', $data);
        
    }
}

?>

If I go to: http://localhost:8888/inmo/index.php/inmo/secret_word I can see the scaffolding page, but if I click to Add New Record, a 404 page is shown.

Is there any problem working with scaffolding and yats together?

Thanks!
#2

[eluser]a&w[/eluser]
[quote author="joseduenas" date="1189987424"]
Is there any problem working with scaffolding and yats together?[/quote]

Answer....no.

I tested scaffolding on the YATS distribution package (see further below) and it worked ok. Maybe it's something with your routing or your .htaccess file if you're using one? I know the URI protocol gave me problems using 'auto' so my setup is below.

Code:
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
//$config['index_page'] = "index.php";
$config['index_page'] = "";

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of "AUTO" works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'            Default - auto detects
| 'PATH_INFO'        Uses the PATH_INFO
| 'QUERY_STRING'    Uses the QUERY_STRING
| 'REQUEST_URI'        Uses the REQUEST_URI
| 'ORIG_PATH_INFO'    Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol']    = "QUERY_STRING";


Code:
<?php

class Welcome extends Controller
{
    function Welcome()
    {
        parent::Controller();

        //To use scaffolding:
        $this->load->scaffolding('properties_sale');
        $this->load->scaffolding('invoices');
    }

    function index()
    {
        /*
         * Do whatever you want and then...
         */

        // Set the template variables
        $data['whatever'] = "If you can read me YATS The Layout Library is working correctly. Good job!";

        // Build the thing
        $this->layout->buildPage('welcome/home', $data);
    }
}

?>
#3

[eluser]Jose Dueñas[/eluser]
Thanks for your reply a&w;.

I'm not using htacess and the content of my route.php file is:

Code:
$route['default_controller'] = "inmo";
$route['scaffolding_trigger'] = "mysecretword";

And, of course, I have the controller inmo.php with this:

Code:
<?php

class Inmo extends Controller
{
    function Inmo()
    {
        parent::Controller();
        $this->load->scaffolding('properties_sale');
    }    
    
    function index()
    {    
        // Set the template valiables
        $data['mensaje'] = "Eso rula";

        // Build the thing
        $this->layout->buildPage('inmo/home', $data);
        
    }
}

?>

I need anymore file? I couldn't guess what's the problem. I've attached an image showing my directories tree.

Thanks again!
#4

[eluser]Jose Dueñas[/eluser]
Ok, I've already found the solution.
I had:
$config['base_url'] = '';

so I changed it to:
$config['base_url'] = 'http://localhost:8888/inmo/';

And now it works.

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB