Jump to content

[SOLVED] Showing html markup instead of links

Recommended Posts


i just hit another problem. Maybe is very easy, but I can not find the place where I am having error. 

So I am doing some admin custom page - it shows requests from users for administrator. Administrator checks request and then should hit button approve or delete request. I am done this by creating table, and for each row in template I want to add also link with some data for GET. 

Problem is that table for some reason does not encode/render the link proper way - it only output html markup. (image 1, 2). 


Maybe I am missing something important? My relevant part of code below:


class ProcessRequests extends Process {

	public function init() {
		parent::init(); // required

	public function ___execute() {

        $requests = new WireArray();
		$match = $this->pages->find("template=request");

        $count = count($requests);
        if ($count) {
            $url = $this->config->urls->admin . 'page/edit/?id=';
            $table = $this->modules->get('MarkupAdminDataTable');

                $this->_('Názov žiadosti'),
				$this->_('Typ žiadosti'),
				$this->_('Týka sa psa'),
                $this->_('Žiadosť podal'),

		foreach ($requests as $key => $u) {

			$mailer = $this->pages->get($u->request_mailer_id);
			$dog_ref = $this->pages->get($u->request_dog_reference->id);

                $count - $key,
                $u->title => $url . $u->id,
				$dog_ref->title => $url . $dog_ref->id,
				date('Y.m.d - H:i', $u->created),
				"<a href=''>Schváliť</a>",

            $out .= $table->render();
        } else {
            $out .= "<p>" . $this->_("Well done, all dogs are edited.") . "</p>";

		return $out;


Thanks for any replies :).

Share this post

Link to post
Share on other sites

Change this line from:

"<a href=''>Schváliť</a>",

to something like:

"<a href='{$page->editUrl}&modal=1' class='pw-panel pw-panel-right'>{$page->title}</a>",

In my module that would open the page editor in a right side panel.

You need to escape those characters in PHP.  See https://phppot.com/php/php-escape-sequences/

Hope that helps

Share this post

Link to post
Share on other sites

 wire( 'sanitizer')->entities( $u->title ) => $url . $u->id,
  wire( 'sanitizer')->entities( $u->request_type->title ),
  wire( 'sanitizer' )->entities( $dog_ref->title ) => $url . $dog_ref->id,
 wire( 'sanitizer' )->entities( $mailer->name ),
"<a href=''>Schváliť</a>", // u NO.entitties on this.ones

  • Like 3

Share this post

Link to post
Share on other sites

Hey @WillyC, nice to read from you again. (Long time no see.) 😉

  • Like 3

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...