⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Add Action Not Working



emiliowill

emiliowill
  • profile picture
  • Member

Posted 09 July 2017 - 20:14 PM

Hi, Im a newbie in Grocery Crud, I was trying to replicate the add action from the web page with a code of my own and it is not working. Here is the code:

 

public function pacientes()
{
try{
$crud = new grocery_CRUD();
$crud->set_language("spanish");
 
$crud->set_table('pacientes');
$crud->columns('nombre','genero','fecha_nacimiento','correo','telefono','edad');
$crud->set_subject('Pacientes');
$crud->callback_column('edad',array($this,'age'));
$crud->callback_add_field('genero'); //,array($this,'add_field_callback_1'));
 
$output = $crud->render();
 
$this->_lab_output($output);
}catch(Exception $e){
show_error($e->getMessage().' --- '.$e->getTraceAsString());
}
 
 
 
function action_print($id)
{
echo "<div style='font-size:16px;font-family:Arial'>";
echo "Just a test function for action button smiley and id: <b>".(int)$id."</b><br/>";
echo "<a href='".site_url('demo/offices_management_with_actions')."'>Go back to example</a>";
echo "</div>";
die();     
}
Once I click in the Action "Imprimir", takes me to this URL: http://127.0.0.1/igniter/index.php/lab/action_print/1
but it displays this message: 
404 Page Not Found

My idea, is to print the information from a selected row.

HELP PLEASE!!!!


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 13 July 2017 - 11:48 AM

Well my friend - i will like you to go through the documentation of the GC library. U seems to be missing quite a lot of piece of document. Refer to the same and you sure to get the desired solution.