Consider the following URL:
http:
I need to get all 6 character strings separated by,, into a Javascript array and paste into my page. Here is my controller action:
public function upload($imageHashes) { $this->set('title_for_layout', 'Uploads successful'); $this->set('imageHashes', explode(',', $imageHashes); $this->layout = 'complex'; }
and in my view file I have the following:
<?php echo $this->Html->scriptBlock('', array('inline' => false)); ?>
Now, it will be very messy to write all Javascript in the scriptBlock method, but I cannot include an external Javascript file because the content changes based on the URL. Is there an easier way to do this that I don't know about?
source share