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 :).

Link to comment
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

Link to comment
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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...