public function redirectByAction($actionName, $controller)
 {
     $url = \wpPluginFramework\WPHelper::getLinkForAction($this->core, $controller, $actionName);
     $this->redirect($url);
 }
Ejemplo n.º 2
0
<form name='AddBlock' method="post" action="<?php 
echo \wpPluginFramework\WPHelper::getLinkForAction($this->core, __CLASS__, __METHOD__);
?>
">
    <label for="AddBlock[name]">Name: </label>
    <input type='text' name="AddBlock[name]" />
    <br/>

    <label for="AddBlock[content]'">Content: </label>
    <br/>
    <textarea name="AddBlock[content]" style='width:80%; height: 150px;'></textarea>
    <br/>

    <input type="submit" value="Add block" >
</form>
Ejemplo n.º 3
0
        <th>Name</th>
        <th>Actions</th>
    </tr>
    </thead>
<?php 
foreach ($models as $model) {
    ?>
    <tr>
       <td style='width:50%'><?php 
    echo $model->name;
    ?>
</td>
       <td>
           <button onclick='location.href="<?php 
    echo \wpPluginFramework\WPHelper::getLinkForAction($this->core, $this, 'actionEditBlock') . '&id=' . $model->_id;
    ?>
"'>
               Edit block
           </button>
           <button onclick='location.href="<?php 
    echo \wpPluginFramework\WPHelper::getLinkForAction($this->core, $this, 'actionDeleteBlock') . '&id=' . $model->_id;
    ?>
"'>
               Delete block
           </button>
       </td>
    </tr>
<?php 
}
?>
</table>
Ejemplo n.º 4
0
<form name='EditBlock' method="post" action="<?php 
echo \wpPluginFramework\WPHelper::getLinkForAction($this->core, $this, 'actionEditBlock');
?>
">
    <label for="EditBlock[name]">Name: </label>
    <input type='text' name="EditBlock[name]" value="<?php 
echo $model->name;
?>
"/>
    <br/>

    <label for="EditBlock[content]'">Content: </label>
    <br/>
    <textarea name="EditBlock[content]" style='width:80%; height: 150px;'><?php 
echo $model->content;
?>
</textarea>
    <br/>

    <input type='hidden' name="id" value="<?php 
echo $model->_id;
?>
"/>

    <input type="submit" value="Apply changes" >
</form>
Ejemplo n.º 5
0
<div id='plugin-content-<?php 
echo $this->pluginPageId;
?>
'>
    <!-- Header -->
    <div>
        <h1><?php 
echo \wpPluginFramework\WPHelper::getPluginName($this->core);
?>
</h1>
        <div>
            <?php 
echo \wpPluginFramework\WPHelper::getPluginDescription($this->core);
?>
        </div>
    </div>

    <!-- Content -->
    <div id='content'>
        <?php 
echo $content;
?>
    </div>

    <!-- Footer -->
</div>