bhaghyasandar bhaghyasandar - 4 months ago 22
PHP Question

Is the object construct $bom-> without a method or property, correct for CodeIgniter?

<?php
echo anchor(site_url('bom/read/'.$bom->),'Read');
echo ' | ';
echo anchor(site_url('bom/update/'.$bom->),'Update');
echo ' | ';
echo anchor(site_url('bom/delete/'.$bom->),'Delete','onclick="javasciprt:return confirm(\'Are You Sure ?\')"');
?>

Answer

First either delete $bam or replace it with correct value

        //$bom should have a value like 123 or 'article' etc
        echo anchor(site_url("bom/read/".$bom),'Read'); 
        echo ' | '; 
        echo anchor(site_url("bom/update/".$bom),'Update'); 
        echo ' | '; 
        echo anchor(site_url("bom/delete/".$bom), 'Delete',array('onclick' =>"javascript:return confirm(\'Are You Sure ?\')"));

      // u can also use this
        echo anchor('news/local/123', 'My News', 'onclick = "javascript:return confirm(\'Are You Sure ?\')"');

Please read (anchor):

http://www.codeigniter.com/user_guide/helpers/url_helper.html

Comments