How to use __unset method of controller class

Best Atoum code snippet using controller.__unset

1acadfd488bc1ab967af323e68338646.php

Source:1acadfd488bc1ab967af323e68338646.php Github

copy

Full Screen

...76 <div class="form-group">77 <label for="table">选择一个表</label>78 <hr>79 <select name="table" class="form-control" id="table" @change="getTableFields" v-model="table">80 <option value="__unset">请选择</option>81 <?php if(is_array($tables) || $tables instanceof \think\Collection || $tables instanceof \think\Paginator): $i = 0; $__LIST__ = $tables;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>82 <option><?php echo $vo; ?></option>83 <?php endforeach; endif; else: echo "" ;endif; ?>84 </select>85 </div>86 <hr>87 <div class="form" v-if="fields && fields.length">88 <div class="row">89 <div class="col-3 flex-vertical text-nowrap">90 <label for="controller">控制器</label>91 <input placeholder="控制器" v-model="controller" class="form-control" id="controller">92 </div>93 <div class="col-3 flex-vertical text-nowrap">94 <label for="controllerName">控制器名称(展示名)</label>95 <input placeholder="控制器名称" v-model="controllerName" class="form-control" id="controllerName">96 </div>97 <div class="col-3 flex-vertical text-nowrap">98 <input v-model="create_node" type="checkbox" id="node">99 <label for="node">创建权限节点</label>100 </div>101 </div>102 <hr>103 <div class="table-responsive">104 <table class="table">105 <thead>106 <tr>107 <th>字段名</th>108 <th>表格组件</th>109 <th>表单组件</th>110 <th>显示名</th>111 <th>添加</th>112 <th>添加规则</th>113 <th>编辑</th>114 <th>编辑规则</th>115 <th>导出</th>116 <th>导入</th>117 <th>操作</th>118 </tr>119 </thead>120 <tbody>121 <tr v-for="(field, index) in fields">122 <td>123 <input class="form-control form-control-sm" placeholder="字段名" v-model="field.field" :id="'f' + index">124 </td>125 <td>126 <input class="form-control form-control-sm" placeholder="表格组件" v-model="field.tc" :id="'tc' + index">127 </td>128 <td>129 <input class="form-control form-control-sm" placeholder="表单组件" v-model="field.fc" :id="'fc' + index">130 </td>131 <td>132 <input class="form-control form-control-sm" placeholder="显示名" v-model="field.name" :id="'fn' + index">133 </td>134 <td>135 <input class="custom-checkbox" type="checkbox" :id="field.field.toLowerCase() + '_add'" v-model="field.add">136 <label :for="field.field.toLowerCase() + '_add'"></label>137 </td>138 <td>139 <input class="form-control form-control-sm" placeholder="添加规则" v-model="field.add_rule">140 </td>141 <td>142 <input class="custom-checkbox" type="checkbox" :id="field.field.toLowerCase() + '_edit'" v-model="field.update">143 <label :for="field.field.toLowerCase() + '_edit'"></label>144 </td>145 <td>146 <input class="form-control form-control-sm" placeholder="编辑规则" v-model="field.update_rule">147 </td>148 <td>149 <input class="custom-checkbox" type="checkbox" :id="field.field.toLowerCase() + '_export'" v-model="field.export">150 <label :for="field.field.toLowerCase() + '_export'"></label>151 </td>152 <td>153 <input class="custom-checkbox" type="checkbox" :id="field.field.toLowerCase() + '_import'" v-model="field.import">154 <label :for="field.field.toLowerCase() + '_import'"></label>155 </td>156 <td>157 <button class="btn btn-sm btn-danger" @click="rmField(index)">删除</button>158 </td>159 </tr>160 </tbody>161 </table>162 </div>163 <hr/>164 <div class="row">165 <div class="col-4 text-center offset-4">166 <button class="btn btn-outline-info btn-sm" @click="addField">新增字段</button>167 </div>168 </div>169 <hr>170 <table class="table">171 <thead>172 <tr>173 <th>字段名</th>174 <th>组件名(类型)</th>175 <th>模糊搜索</th>176 <th>操作</th>177 </tr>178 </thead>179 <tbody>180 <tr v-for="(s, i) in search">181 <td>182 <select class="form-control-sm form-control" :id="'sf' + i" v-model="s.field" @change="checkSearch($event, i)">183 <option value="__unset">选择字段</option>184 <option v-for="sf in fields">{{ sf.field }}</option>185 </select>186 </td>187 <td>188 <input class="form-control-sm form-control" placeholder="组件名(类型)" v-model="s.type" :id="'st' + i">189 </td>190 <td class="flex-vertical">191 <input placeholder="模糊搜索" type="checkbox" v-model="s.like" :id="'sl' + i">192 <label :for="'sl' + i">模糊搜索</label>193 </td>194 <td>195 <button class="btn btn-danger btn-sm" @click="rmSearch(i)">删除</button>196 </td>197 </tr>198 </tbody>199 </table>200 <hr>201 <div class="row">202 <div class="col-4 text-center offset-4">203 <button class="btn btn-outline-info btn-sm" @click="addSearch">新增搜索字段</button>204 </div>205 </div>206 <hr>207 <div class="form-group">208 <button class="btn btn-success" @click="submit">提交</button>209 <button class="btn btn-warning" @click="getTableFields">重置</button>210 </div>211 </div>212</div>213 </div>214 </div>215</div>216<!-- 图片加载失败处理 -->217<script type="text/javascript">218 elementMap('img', function (i) {219 i.addEventListener('error', function (e) {220 this.src = "/static/img/image_not_found.jpg";221 this.classList.add('border-danger', 'img-failed');222 this.title = '无法找到该图片';223 }, false);224 });225</script>226<!-- 自定义 js -->227<script src="/static/common/vue.js"></script>228<script type="text/javascript">229 var app = new Vue({230 el: '#app',231 data: {232 fields: [],233 controller: '',234 controllerName: '',235 table: '__unset',236 create_node: true,237 search: []238 },239 methods: {240 /**241 * 获取字段信息242 */243 getTableFields () {244 if (this.table === '__unset') {245 this.controller = '';246 this.fields = [];247 this.search = [];248 return;249 }250 var val = this.table;251 var loading = layer.load(2);252 this.controller = val;253 var _this = this;254 api.get('/api/generate/table_fields', {255 params: {256 name: val257 }258 }).then(function (response) {259 var data = response.data;260 if (data.err) throw data.msg;261 _this.fields = data.map(function (i) {262 return {263 field: i.Field,264 tc: 'text',265 fc: 'text',266 name: null,267 add: true,268 add_rule: '',269 update: true,270 update_rule: '',271 export: true,272 import: true273 };274 });275 layer.close(loading);276 }).catch(function (err) {277 layer.close(loading);278 layer.open({279 icon: 2,280 title: '请求失败',281 content: err instanceof String ? err : err.toString()282 });283 })284 },285 /**286 * 新增字段287 */288 addField () {289 this.fields.push({290 field: '',291 tc: 'text',292 fc: 'text',293 name: null,294 add: true,295 update: true,296 export: true,297 import: true298 });299 },300 /**301 * 删除字段302 * @param i303 */304 rmField (i) {305 this.fields.splice(i, 1);306 },307 submit () {308 if (this.table === '__unset') {309 layer.tips('请选择数据表', '#table', {310 tips: 1311 });312 throw 'invalid table name';313 }314 if (this.controller === '' || !this.controller) {315 layer.tips('请填写控制器', '#controller', {316 tips: 1317 });318 throw 'invalid controller name';319 }320 if (this.controllerName === '' || !this.controllerName) {321 layer.tips('请填写控制器名称(展示名)', '#controllerName', {322 tips: 1323 });324 throw 'invalid controller name';325 }326 this.fields.forEach(function (i, n) {327 if (!i.field || i.field === '') {328 layer.tips('请填写该字段', '#f' + n);329 throw 'invalid fields';330 }331 if (!i.name || i.name === '') {332 layer.tips('请填写该字段', '#fn' + n);333 throw 'invalid fields';334 }335 if (!i.fc || i.fc === '') {336 layer.tips('请填写该字段', '#fc' + n);337 throw 'invalid fields';338 }339 });340 var _this = this;341 api.get('/api/generate/run', {params: _this.$data})342 .then(function (response) {343 console.log(response.data);344 if (response.data === true) {345 layer.msg('success');346 } else {347 throw response.data.msg348 }349 })350 .catch(function (err) {351 console.warn(err);352 });353 },354 addSearch () {355 this.search.push({field: '__unset', type: 'text', like: false})356 },357 rmSearch (i) {358 this.search.splice(i, 1);359 },360 checkSearch ($event, i) {361 var _this = this;362 this.search.forEach(function (s, x) {363 if (s.field === $event.target.value && x !== i && s.field !== '__unset') {364 _this.search[i].field = '__unset';365 layer.msg('不能选择重复的字段');366 }367 })368 }369 }370 });371</script>372</body>373</html>...

Full Screen

Full Screen

Application.php

Source:Application.php Github

copy

Full Screen

...137 */138 protected function logoutSession()139 {140 $session = Yaf\Session::getInstance();141 $session->__unset('user_id');142 $session->__unset('user_name');143 $session->__unset('mobile');144 $session->__unset('user_sex');145 }146 protected function checkLogin()147 {148 $session = Yaf\Session::getInstance();149 if (!isset($session->user_id)) {150 $this->redirect("/login");151 }152 }153}...

Full Screen

Full Screen

pppValidation.php

Source:pppValidation.php Github

copy

Full Screen

...65 $this->errors['error_msg'] = $e->getMessage();66 } finally {67 $this->transaction_detail = $method_ppp->getDetailsTransaction();68 }69 Context::getContext()->cookie->__unset('paypal_plus_payment');70 Context::getContext()->cookie->__unset('paypal_pSc');71 Context::getContext()->cookie->__unset('paypal_pSc_payerid');72 Context::getContext()->cookie->__unset('paypal_pSc_email');73 if (!empty($this->errors)) {74 $this->redirectUrl = Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors);75 }76 }77}...

Full Screen

Full Screen

__unset

Using AI Code Generation

copy

Full Screen

1$obj->unsetMethod();2$obj->unsetMethod();3$obj->unsetMethod();4$obj->unsetMethod();5$obj->unsetMethod();6$obj->unsetMethod();7$obj->unsetMethod();8$obj->unsetMethod();9$obj->unsetMethod();10$obj->unsetMethod();11$obj->unsetMethod();12$obj->unsetMethod();13$obj->unsetMethod();14$obj->unsetMethod();15$obj->unsetMethod();16$obj->unsetMethod();17$obj->unsetMethod();18$obj->unsetMethod();19$obj->unsetMethod();20$obj->unsetMethod();21$obj->unsetMethod();22$obj->unsetMethod();23$obj->unsetMethod();24$obj->unsetMethod();25$obj->unsetMethod();26$obj->unsetMethod();27$obj->unsetMethod();28$obj->unsetMethod();29$obj->unsetMethod();30$obj->unsetMethod();31$obj->unsetMethod();32$obj->unsetMethod();33$obj->unsetMethod();34$obj->unsetMethod();35$obj->unsetMethod();36$obj->unsetMethod();37$obj->unsetMethod();38$obj->unsetMethod();39$obj->unsetMethod();40$obj->unsetMethod();41$obj->unsetMethod();42$obj->unsetMethod();

Full Screen

Full Screen

__unset

Using AI Code Generation

copy

Full Screen

1$this->controller->__unset('name');2$this->controller->__unset('email');3$this->controller->__unset('phone');4$this->controller->__unset('address');5$this->controller->__unset('city');6$this->controller->__unset('state');7$this->controller->__unset('zip');8$this->controller->__unset('name');9$this->controller->__unset('email');10$this->controller->__unset('phone');11$this->controller->__unset('address');12$this->controller->__unset('city');13$this->controller->__unset('state');14$this->controller->__unset('zip');15$this->controller->__unset('name');16$this->controller->__unset('email');17$this->controller->__unset('phone');18$this->controller->__unset('address');19$this->controller->__unset('city');20$this->controller->__unset('state');21$this->controller->__unset('zip');22$this->controller->__unset('name');23$this->controller->__unset('email');24$this->controller->__unset('phone');25$this->controller->__unset('address');26$this->controller->__unset('city');27$this->controller->__unset('state');28$this->controller->__unset('zip');29$this->controller->__unset('name');30$this->controller->__unset('email');31$this->controller->__unset('phone');32$this->controller->__unset('address');33$this->controller->__unset('city');34$this->controller->__unset('state');35$this->controller->__unset('zip');36$this->controller->__unset('name');37$this->controller->__unset('email');38$this->controller->__unset('phone');39$this->controller->__unset('address');40$this->controller->__unset('city');41$this->controller->__unset('state');42$this->controller->__unset('zip');43$this->controller->__unset('name');44$this->controller->__unset('email');45$this->controller->__unset('phone');46$this->controller->__unset('address');47$this->controller->__unset('city');48$this->controller->__unset('state');49$this->controller->__unset('

Full Screen

Full Screen

__unset

Using AI Code Generation

copy

Full Screen

1$obj->unset();2echo $obj->get();3$obj->set($val);4$obj->call();5$obj::callStatic();6$obj();7echo $obj;8$obj->clone();9$obj->sleep();10$obj->wakeup();11$obj->set_state();12$obj->debugInfo();13$obj->isset();14$obj->destruct();15$obj->construct();16$obj->autoload();17$obj::invokeStatic();18$obj::autoloadStatic();19$obj->unset();20echo $obj->get();21$obj->set($val);22$obj->call();23$obj::callStatic();24$obj();25echo $obj;26$obj->clone();27$obj->sleep();28$obj->wakeup();29$obj->set_state();30$obj->debugInfo();31$obj->isset();

Full Screen

Full Screen

__unset

Using AI Code Generation

copy

Full Screen

1$this->load->controller('catalog/category');2$controller = new ControllerCatalogCategory($this->registry);3$controller->index();4$controller->id = 1;5unset($controller->id);6$this->load->model('catalog/category');7$model = new ModelCatalogCategory($this->registry);8$model->id = 1;9unset($model->id);10$this->load->view('catalog/category');11$view = new ViewCatalogCategory($this->registry);12$view->id = 1;13unset($view->id);14$this->load->model('catalog/category');15$model = new ModelCatalogCategory($this->registry);16$model->id = 1;17$model->__unset('id');18$this->load->view('catalog/category');19$view = new ViewCatalogCategory($this->registry);20$view->id = 1;21$view->__unset('id');22$this->load->model('catalog/category');23$model = new ModelCatalogCategory($this->registry);24$model->id = 1;25$model->remove('id');26$this->load->view('catalog/category');27$view = new ViewCatalogCategory($this->registry);28$view->id = 1;29$view->remove('id');30$this->load->model('catalog/category');31$model = new ModelCatalogCategory($this->registry);32$model->id = 1;33$model->delete('id');34$this->load->view('catalog/category');35$view = new ViewCatalogCategory($this->registry);36$view->id = 1;37$view->delete('id');38$this->load->model('catalog/category');39$model = new ModelCatalogCategory($this->registry);40$model->id = 1;41$model->destroy('id

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Atoum automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in controller

Trigger __unset code on LambdaTest Cloud Grid

Execute automation tests with __unset on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful