Jump to content

Can't Get Widget To Display When Staff Views Client's Profile


velaware

Recommended Posts

This is part of my database manager plugin.  I'm trying to create a widget that shows on a client's profile when a staff member goes to view it.  Here's the files in question: https://gist.github.com/anzenehansen/eb26e30a8c1f8169bc66

 

The widget code is a simple boiler template that just has

<?php
$this->Widget->clear();
$this->Widget->create("Database Manager");
?>
<div class="inner">Tester</div>
<?php $this->Widget->end(); ?>

Nothing fancy yet so I'm not sure why this isn't displaying.  I've also tried:

$this->Widget->create(null, "Database Manager");

Still nothing is rendered.  The page loads fine otherwise, however.

Link to comment
Share on other sites

Just glanced at it and it looks like your AdminMain controller does not call preAction().

 

i.e.

/**
* Pre action
 */
public function preAction() {
    parent::preAction();
    #
    # TODO: load other stuff, like models, helpers, language, etc.
    #
}
Link to comment
Share on other sites

There are minute differences, mostly internal, the biggest being that the WidgetClient doesn't support tabs. Aside from that they're pretty much identical.

That works for me, lol.

 

Wondering, how do I display text on a widget?  I have this codei n my AdminMain controller's index function:

$e = "test";
$d = "bob";

$this->set(compact("e", "d"));

return $this->renderAjaxWidgetIfAsync(false);

In the view file I have this:

<?php echo($e . "=" . $d); ?>

The code in the vie wfile makes the widget not render at all.

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

Guest
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.

Loading...
×
×
  • Create New...