i just faced a very strange problem today.
My Application Structure is:
/app
– /controllers
—-/editor.php
– / views
—-/test.php
/public
/system
i use codeigniter for php and raphaeljs library for canvas operations.
There is this trich with RaphaelJS about filling path objects with image:
http://www.irunmywebsite.com/raphael/additionalhelp.php?q=path#PAGETOP
i tested it under public directory and it worked perfectly
but whenever i try to run same exact codes under /app dir. with codeigniter, it is somehow blocking gradient and image filling and instead filling objects with black color.
i guess it’s about the way codeigniter handles URLs
i’ve got this function in editor controller class :
public function test()
{
$this->load->view('editor/test');
}
test.php :
<html>
<head>
<?php $this->load->helper('url'); ?>
<base href="<?php echo base_url(); ?>">
<script type="text/javascript" src="./public/js/raphael-min15.js"></script>
</head>
<body>
<div id="canvas"></div>
<script>
..
..
// same script on the page linked above
..
..
</script>
</body>
</html>
removing base tag solves the problem.