Does anyone know what I need to edit in the console code to modify the
default code that bake renders? As good as bake is I still find that I need
to spend a lot of time going through all the code it creates for me making
the same adjustments each time.
Any hints on what needs to be done would be appreciated.
AS an FYI, I'd like to do 2 things:
Change the coding style to this
function foo()
{
if( $bar == 1 )
{
$this->redirect( array( 'controller' => 'view' ) );
}
}
Modify the add method to include an ajax save for all controllers:
function add()
{
if ( !empty( $this->data ) )
{
$this->Person->create();
//ajax save
if( $this->RequestHandler->isAjax() )
{
if( $this->Person->save( $this->data ) ) {
$this->set( 'people',
$this->Person->find( 'list' ) );
$this->view = 'Json';
$this->set( 'json', 'people' );
}
Configure::write( 'debug', 0 );
}
//standard save
else
{
if ( $this->Person->save( $this->data ) )
{
$this->Session->setFlash( __( 'The
Person has been saved', true ) );
$this->redirect(array( 'action' =>
'index' ) );
}
else
{
$this->Session->setFlash( __( 'The
Person could not be saved. Please,
try again.', true ) );
}
}
}
}
--
View this message in context:
http://www.nabble.com/Modify-bakes-rendered-code-tp24358859p24358859.html
Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---