EllisLab text mark
Advanced Search
     
Yats and scaffolding
Posted: 16 September 2007 04:03 PM   [ Ignore ]
Avatar
Joined: 2007-09-16
27 posts

Hi folks!
I’m having some problems with scaffolding and yats.

I have my controller like that:

<?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!

 Signature 

My blog: http://www.joseduenas.com

 
Posted: 16 September 2007 04:43 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2007-04-03
118 posts
joseduenas - 16 September 2007 08:03 PM

Is there any problem working with scaffolding and yats together?

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. 

|--------------------------------------------------------------------------
Index File
|--------------------------------------------------------------------------
|
Typically this will be your index.php fileunless 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"; 
<?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);
    
}
}

?> 
 
Posted: 16 September 2007 09:13 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2007-09-16
27 posts

Thanks for your reply a&w;.

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

$route['default_controller'"inmo";
$route['scaffolding_trigger'"mysecretword"

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

<?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!

 Signature 

My blog: http://www.joseduenas.com

 
Posted: 16 September 2007 09:42 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2007-09-16
27 posts

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!

 Signature 

My blog: http://www.joseduenas.com